Skip to content

Commit

Permalink
Make documentation consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
oculus42 committed Jul 16, 2018
1 parent 38827c0 commit 4b68cb0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ When passed as a string, it will be used as the `href` attribute of a `<base>` t
#### formValues
This setting copies the current values of form elements into the printThis iframe. On by default.

#### canvas -- Experimental
#### canvas
As of 1.9.0 you may be able to duplicate canvas elements to the printThis iframe. Disabled by default.
This has received only limited testing and so may not work in all browsers and situations.

Expand All @@ -105,31 +105,45 @@ A doctype string to use on the printThis iframe. Defaults to the HTML5 doctype.
#### removeScripts
Deletes script tags from the content to avoid errors or unexpected behavior during print. Disabled by default.

#### copyTagClasses: false // copy classes from the html & body tag
Copies classes from the body and html tags into the printThis iframe.
Accepts `true` or test for the strings `"b"` and `"h"` for the body and html tags, respectively.
#### copyTagClasses: false
Copies classes from the body and html tags into the printThis iframe.
Accepts `true` or test for the strings `"b"` and `"h"` for the body and html tags, respectively.
Disabled by default.

#### beforePrintEvent: null
Function to run inside the iframe before the print occurs.
*This function has not been validated on all browsers.*

#### beforePrint: null
Function called before the iframe is populated with content.

#### afterPrint: null
Function called after the print and before the iframe is removed from the page.
This is called even if `debug: true`, which does not remove the iframe.

### All Options
```javascript
$("#mySelector").printThis({
debug: false, // show the iframe for debugging
importCSS: true, // import page CSS
importCSS: true, // import parent page css
importStyle: false, // import style tags
printContainer: true, // grab outer container as well as the contents of the selector
loadCSS: "path/to/my.css", // path to additional css file - use an array [] for multiple
printContainer: true, // print outer container/$.selector
loadCSS: "", // path to additional css file - use an array [] for multiple
pageTitle: "", // add title to print page
removeInline: false, // remove all inline styles from print elements
removeInlineSelector: "*", // filter elements from which to remove inline styles
printDelay: 333, // variable print delay; depending on complexity a higher value may be necessary
removeInline: false, // remove inline styles from print elements
removeInlineSelector: "*", // custom selectors to filter inline styles. removeInline must be true
printDelay: 333, // variable print delay
header: null, // prefix to html
footer: null, // postfix to html
base: false , // preserve the BASE tag, or accept a string for the URL
base: false, // preserve the BASE tag or accept a string for the URL
formValues: true, // preserve input/form values
canvas: false, // copy canvas elements (experimental)
doctypeString: "...", // enter a different doctype for older markup
canvas: false, // copy canvas content
doctypeString: '...', // enter a different doctype for older markup
removeScripts: false, // remove script tags from print content
copyTagClasses: false // copy classes from the html & body tag
copyTagClasses: false, // copy classes from the html & body tag
beforePrintEvent: null, // function for printEvent in iframe
beforePrint: null, // function called before iframe is filled
afterPrint: null // function called before iframe is removed
});
```

Expand Down
8 changes: 4 additions & 4 deletions printThis.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* removeScripts: false, // remove script tags from print content
* copyTagClasses: false // copy classes from the html & body tag
* beforePrintEvent: null, // callback function for printEvent in iframe
* beforePrint: null, // callback to trigger before iframe is filled
* afterPrint: null // callback to trigger before iframe is removed
* beforePrint: null, // function called before iframe is filled
* afterPrint: null // function called before iframe is removed
* });
*
* Notes:
Expand Down Expand Up @@ -323,7 +323,7 @@
removeScripts: false, // remove script tags from print content
copyTagClasses: false, // copy classes from the html & body tag
beforePrintEvent: null, // callback function for printEvent in iframe
beforePrint: null, // callback to trigger before iframe is filled
afterPrint: null // callback to trigger before iframe is removed
beforePrint: null, // function called before iframe is filled
afterPrint: null // function called before iframe is removed
};
})(jQuery);

0 comments on commit 4b68cb0

Please sign in to comment.