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

sem sumário de edição
imported>Jaideraf
m (uma edição)
Sem resumo de edição
 
/* jshint esversion: 10 */
function Export2Doc( element, filename = ""'') ){
const content1 =
let content1 = '<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 14"> <meta name=Originator content="Microsoft Word 14"> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Pages>1</o:Pages> <o:Words>95</o:Words> <o:Characters>516</o:Characters> <o:Lines>4</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>610</o:CharactersWithSpaces> <o:Version>14.00</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} p {mso-style-noshow:yes; mso-style-priority:99; font-size:11.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;} @page WordSection1 {size:595.3pt 841.9pt; margin:70.85pt 3.0cm 70.85pt 3.0cm; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tabela normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Times New Roman","serif";} </style> <![endif]--> <meta charset=utf-8> <!--[if gte mso 9]><xml><o:shapedefaults v:ext="edit" spidmax="1026"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body lang=PT-BR style="tab-interval:35.4pt"> <div class=WordSection1>';
const content2 =
let content2 = '"<p class=MsoNormal align=center style=\'text-align:center\'><span style=\'mso-fareast-font-family:\"Times New Roman\"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;>'";
letconst content3 = document.getElementById("'cipParagraph"').textContent;
const content4 =
let content4 = '<o:p></o:p></span></p><p class=MsoNormal><span style=\'mso-fareast-font-family:"Times New Roman"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;><o:p>&nbsp;</o:p></span></p>';
letconst content5 = document.getElementById(element).innerHTML;
const content6 =
let content6 = '"<p class=MsoNormal><span style=\'mso-fareast-font-family:\"Times New Roman"\"' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;><o:p>&nbsp;</o:p></span></p><p class=MsoNormal align=center style=\'text-align:center\'><span style=\'mso-fareast-font-family:\"Times New Roman"\"' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;>'";
letconst content7 = document.getElementById("'credit"').textContent;
letconst content8 = "'<o:p></o:p></span></p>"';
letconst postHtml = "'</div></body></" + "html>"';
const html =
content1 +
content2 +
content3 +
content4 +
content5 +
content6 +
content7 +
content8 +
postHtml;
 
letconst blob = new Blob(["'\ufeff"', html], {
let content1 = '<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 14"> <meta name=Originator content="Microsoft Word 14"> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Pages>1</o:Pages> <o:Words>95</o:Words> <o:Characters>516</o:Characters> <o:Lines>4</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>610</o:CharactersWithSpaces> <o:Version>14.00</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} p {mso-style-noshow:yes; mso-style-priority:99; font-size:11.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;} @page WordSection1 {size:595.3pt 841.9pt; margin:70.85pt 3.0cm 70.85pt 3.0cm; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tabela normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Times New Roman","serif";} </style> <![endif]--> <meta charset=utf-8> <!--[if gte mso 9]><xml><o:shapedefaults v:ext="edit" spidmax="1026"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body lang=PT-BR style="tab-interval:35.4pt"> <div class=WordSection1>';
type: "'application/msword"',
let content2 = '<p class=MsoNormal align=center style=\'text-align:center\'><span style=\'mso-fareast-font-family:"Times New Roman"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;>';
});
let content3 = document.getElementById("cipParagraph").textContent;
let content4 = '<o:p></o:p></span></p><p class=MsoNormal><span style=\'mso-fareast-font-family:"Times New Roman"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;><o:p>&nbsp;</o:p></span></p>';
let content5 = document.getElementById(element).innerHTML;
let content6 = '<p class=MsoNormal><span style=\'mso-fareast-font-family:"Times New Roman"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;><o:p>&nbsp;</o:p></span></p><p class=MsoNormal align=center style=\'text-align:center\'><span style=\'mso-fareast-font-family:"Times New Roman"\' font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt;>';
let content7 = document.getElementById("credit").textContent;
let content8 = "<o:p></o:p></span></p>";
let postHtml = "</div></body></" + "html>";
let html = content1 + content2 + content3 + content4 +
content5 + content6 + content7 + content8 + postHtml;
 
// Specify filelink nameurl
let blob = new Blob(["\ufeff", html], {
letconst url = "`data:application/vnd.ms-word;charset=utf-8," +${encodeURIComponent(html)}`;
type: "application/msword"
});
 
// Specify linkfile urlname
filename = filename ? `${filename}.doc` : 'document.doc';
let url = "data:application/vnd.ms-word;charset=utf-8," +
encodeURIComponent( html );
 
// Create download link element
// Specify file name
letconst downloadLink = document.createElement( "'a" ');
filename = (
filename
? filename + ".doc"
: "document.doc"
);
 
document.body.appendChild( downloadLink );
// Create download link element
let downloadLink = document.createElement( "a" );
 
if if( navigator.msSaveOrOpenBlob) ){
document.body.appendChild( downloadLink );
navigator.msSaveOrOpenBlob(blob, filename);
} else {
// Create a link to the file
downloadLink.href = url;
 
// Setting the file name
if( navigator.msSaveOrOpenBlob ){
navigatordownloadLink.msSaveOrOpenBlob(download blob,= filename );
} else {
// Create a link to the file
downloadLink.href = url;
 
// Settingtriggering the file namefunction
downloadLink.download = filenameclick();
}
 
document.body.removeChild( downloadLink );
//triggering the function
downloadLink.click();
}
 
document.body.removeChild( downloadLink );
}