modernizr.js is not modified because it's not our code.
En passant fixes:
* Delete two scripts that depended on a Yahoo service that
appears no longer to exist.
* The PhantomJS website no longer has a leading www.
* One script needed correction to *work* in strict mode.
* One script would only exit if a page loaded successfully.
(There may be other instances of this problem, this is the
one I noticed.)
Added CoffeeScript examples where missing, minor other fixes such as spacing standardization (2 spaces is the standard in CoffeeScript via Ruby). Also a small set of minor JS example fixes and additional comments.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=907
The comment now explains how to delegate the header/footer setup
to the loaded HTML page by giving an explicit HTML example that
defines the required PhantomJSPrinting object
ISSUE: 512 (http://code.google.com/p/phantomjs/issues/detail?id=512)
Usage:
page.paperSize = {
margin: "1cm",
header: {
height: "1cm",
contents: phantom.callback(function(pageNum, numPages) {
return "<h1>" + pageNum + " / " + numPages + "</h1>";
})
},
footer: {
height: "0.5cm",
contents: phantom.callback(function(pageNum, numPages) {
return "<h2>" + pageNum + " / " + numPages + "</h1>";
})
}
};
Note: The contents can return arbitrary HTML but since we cannot
re-layout the whole website for every page, the header/footers
must have the static height defined in the height property.
Note: The new example printheaderfooter.js shows the usage. It
also shows how one could delegate the above to a JavaScript
function on the loaded website, which allows one to print pages
and let the actually printed page decide how the header/footer
should look like.
Note: The page-counter can be reset by adding the class "phantomjs_reset_pagination"
to HTML block-elements that should reset the counter.
ISSUE: 410 (http://code.google.com/p/phantomjs/issues/detail?id=410)