Skip to content

Commit

Permalink
remove unnecessary closing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed May 31, 2018
1 parent 7bd5a21 commit 17e273b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "print-js",
"homepage": "http://printjs.crabbly.com",
"description": "A tiny javascript library to help printing from the web.",
"version": "1.0.43",
"version": "1.0.44",
"main": "dist/print.js",
"repository": "https://github.com/crabbly/Print.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default {
case 'pdf':
// Check browser support for pdf and if not supported we will just open the pdf file instead
if (Browser.isFirefox() || Browser.isEdge() || Browser.isIE()) {
console.log('PrintJS currently doesn\'t support PDF printing in Firefox, Internet Explorer and Edge.')
console.info('PrintJS currently doesn\'t support PDF printing in Firefox, Internet Explorer and Edge.')
let win = window.open(params.fallbackPrintable, '_blank')
win.focus()
// Make sure there is no loading modal opened
Expand Down
26 changes: 13 additions & 13 deletions src/js/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export default {
// Check if there is a header on top of the table
if (params.header) htmlData += '<h1 style="' + params.headerStyle + '">' + params.header + '</h1>'

// Build html data
// Build the printable html data
htmlData += jsonToHTML(params)

// Store html data
// Store the data
params.htmlData = addWrapper(htmlData, params)

// Print json data
// Print the json data
Print.send(params, printFrame)
}
}
Expand All @@ -41,34 +41,34 @@ function jsonToHTML (params) {
let data = params.printable
let properties = params.properties

// Create a html table and define the header as repeatable
// Create a html table
let htmlData = '<table style="border-collapse: collapse; width: 100%;">'

// Check if the header should be repeated
if (params.repeatTableHeader) {
htmlData += '<thead>'
}

// Create the table row
// Add the table header row
htmlData += '<tr>'

// Create a table header for each column
// Add the table header columns
for (let a = 0; a < properties.length; a++) {
htmlData += '<th style="width:' + 100 / properties.length + '%; ' + params.gridHeaderStyle + '">' + capitalizePrint(properties[a]) + '</th>'
}

// Add the closing tag for the table row
// Add the closing tag for the table header row
htmlData += '</tr>'

// Check if the table header is marked as repeated, then add the closing tag
// If the table header is marked as repeated, add the closing tag
if (params.repeatTableHeader) {
htmlData += '</thead>'
}

// Add the closing tag for the table body
htmlData += '</tr></thead><tbody>'
// Create the table body
htmlData += '<tbody>'

// Add the table rows
// Add the table data rows
for (let i = 0; i < data.length; i++) {
// Add the row starting tag
htmlData += '<tr>'
Expand All @@ -91,11 +91,11 @@ function jsonToHTML (params) {
htmlData += '<td style="width:' + 100 / properties.length + '%;' + params.gridStyle + '">' + stringData + '</td>'
}

// Add the row ending tag
// Add the row closing tag
htmlData += '</tr>'
}

// Add the table closing tag
// Add the table and body closing tags
htmlData += '</tbody></table>'

return htmlData
Expand Down

0 comments on commit 17e273b

Please sign in to comment.