Revisions
-
ckknight revised this gist
Jun 25, 2013 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,14 @@ (function(){ var oldPrint = window.print; var slice = Array.prototype.slice; window.print = function () { if (typeof window.onbeforeprint === "function") { window.onbeforeprint.apply(this, slice.call(arguments)); } oldPrint.apply(this, slice.call(arguments)); if (typeof window.onafterprint === "function") { window.onafterprint.apply(this, slice.call(arguments)); } }; }()); -
ckknight revised this gist
Jun 25, 2013 . 1 changed file with 10 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,13 @@ (function(){ var oldPrint = window.print; window.print = function () { if (typeof window.onbeforeprint === "function") { window.onbeforeprint.apply(this, arguments); } oldPrint.apply(this, arguments); if (typeof window.onafterprint === "function") { window.onafterprint.apply(this, arguments); } }; }()); -
NeilHanlon revised this gist
Jun 25, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,11 @@ var _print = this.print; // create a new window.print window.print = function (window) { // if `onbeforeprint` exists, call it. if(this.onbeforeprint) onbeforeprint(this); // call the original `window.print`. _print.apply(this); // if `onafterprint` exists, call it. if (this.onafterprint) onafterprint(this); } -
NeilHanlon created this gist
Jun 25, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ (function(){ // make a copy of the native window.print var _print = this.print; // create a new window.print window.print = function () { // if `onbeforeprint` exists, call it. if (this.onbeforeprint) onbeforeprint(this); // call the original `window.print`. _print(); // if `onafterprint` exists, call it. if (this.onafterprint) onafterprint(this); } }());