diff --git a/package.json b/package.json index 746b073..bf4d858 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/js/init.js b/src/js/init.js index 6cc4d95..c56c0b4 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -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 diff --git a/src/js/json.js b/src/js/json.js index 3df7863..32cd957 100644 --- a/src/js/json.js +++ b/src/js/json.js @@ -25,13 +25,13 @@ export default { // Check if there is a header on top of the table if (params.header) htmlData += '

' + params.header + '

' - // 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) } } @@ -41,7 +41,7 @@ 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 = '' // Check if the header should be repeated @@ -49,26 +49,26 @@ function jsonToHTML (params) { htmlData += '' } - // Create the table row + // Add the table header row htmlData += '' - // Create a table header for each column + // Add the table header columns for (let a = 0; a < properties.length; a++) { htmlData += '' } - // Add the closing tag for the table row + // Add the closing tag for the table header row htmlData += '' - // 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 += '' } - // Add the closing tag for the table body - htmlData += '' + // Create the table body + htmlData += '' - // Add the table rows + // Add the table data rows for (let i = 0; i < data.length; i++) { // Add the row starting tag htmlData += '' @@ -91,11 +91,11 @@ function jsonToHTML (params) { htmlData += '' } - // Add the row ending tag + // Add the row closing tag htmlData += '' } - // Add the table closing tag + // Add the table and body closing tags htmlData += '
' + capitalizePrint(properties[a]) + '
' + stringData + '
' return htmlData