File size: 3,662 Bytes
3f268e5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
/*
* Copyright 2017 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
/* eslint require-jsdoc: "off" */
var body;
function bodyReset() {
body = '';
}
function bodyH1(txt) {
body += '<h1 style="font-size:16px;font-family:arial,sans,sans-serif;">' +
txt + '</h1>';
}
function bodyH2(txt) {
body += '<h2 style="font-size:15px;font-family:arial,sans,sans-serif;">' +
txt + '</h2>';
}
function bodyH3(txt) {
body += '<h3 style="font-size:14px;font-family:arial,sans,sans-serif;">' +
txt + '</h3>';
}
function bodyH4(txt) {
body += '<h4 style="font-size:13px;font-family:arial,sans,sans-serif;">' +
txt + '</h4>';
}
function bodyPar(txt) {
body += '<p style="font-size:13px;font-family:arial,sans,sans-serif;">' +
txt + '</p>';
}
function bodyAdd(txt) {
body += txt;
}
var bodyTableBodyAdded = false;
function bodyTableStart(width) {
bodyTableBodyAdded = false;
if (width) {
body += '<table cellspacing="1" cellpadding="1" dir="ltr" border="1" ' +
'style="table-layout:fixed;font-size:13px;font-family:arial,sans,' +
'sans-serif;border-collapse:collapse;border:1px solid rgb(204,204,204)">';
} else
body += '<table cellspacing="10" cellpadding="10" dir="ltr" border="1" ' +
'style="table-layout:fixed;font-size:13px;font-family:arial,sans,' +
'sans-serif;border-collapse:collapse;border:1px solid rgb(204,204,204)">';
}
function bodyTableTh(tth) {
body += '<tr>';
for (var ii = 0; ii < tth.length; ii++)
body += '<th align="left" valign="top">' + tth[ii] + '</th>';
body += '</tr>';
}
function bodyTableTd(ttd) {
if (!bodyTableBodyAdded) body += '<tbody>';
body += '<tr>';
for (var ii = 0; ii < ttd.length; ii++)
body += '<td align="left" valign="top"> ' + ttd[ii] + ' </td>';
body += '</tr>';
}
function bodyTableTdStyle(ttd, style) {
if (!bodyTableBodyAdded) body += '<tbody>';
body += '<tr>';
for (var ii = 0; ii < ttd.length; ii++)
body += '<td align="left" valign="top" style="' + style + '"> ' +
ttd[ii] + ' </td>';
body += '</tr>';
}
function bodyTableTdStyleProp(ttd) {
if (!bodyTableBodyAdded) body += '<tbody>';
body += '<tr>';
for (var ii = 0; ii < ttd.length; ii++)
if (ttd[ii].style === undefined)
body += '<td align="left" valign="top"> ' + ttd[ii].txt + ' </td>';
else
body += '<td align="left" valign="top" style="' +
ttd[ii].style + '"> ' + ttd[ii].txt + ' </td>';
body += '</tr>';
}
function bodyTableEnd() {
body += '</tbody></table>';
}
function bodyGet() {
return body;
}
module.exports.bodyReset = bodyReset;
module.exports.bodyH1 = bodyH1;
module.exports.bodyH2 = bodyH2;
module.exports.bodyH3 = bodyH3;
module.exports.bodyH4 = bodyH4;
module.exports.bodyPar = bodyPar;
module.exports.bodyAdd = bodyAdd;
module.exports.bodyTableStart = bodyTableStart;
module.exports.bodyTableTh = bodyTableTh;
module.exports.bodyTableTd = bodyTableTd;
module.exports.bodyTableTdStyle = bodyTableTdStyle;
module.exports.bodyTableTdStyleProp = bodyTableTdStyleProp;
module.exports.bodyTableEnd = bodyTableEnd;
module.exports.bodyGet = bodyGet;
|