printwidget.js
31 lines
| 850 B
| application/javascript
|
JavascriptLexer
Stefan van der Walt
|
r4615 | var IPython = (function (IPython) { | ||
Brian Granger
|
r5857 | var PrintWidget = function () { | ||
Stefan van der Walt
|
r4615 | }; | ||
PrintWidget.prototype.print_notebook = function () { | ||||
var w = window.open('', '_blank', 'scrollbars=1,menubar=1'); | ||||
var html = '<html><head>' + | ||||
$('head').clone().html() + | ||||
'<style type="text/css">' + | ||||
'@media print { body { overflow: visible !important; } }' + | ||||
'.ui-widget-content { border: 0px; }' + | ||||
'</style>' + | ||||
'</head><body style="overflow: auto;">' + | ||||
$('#notebook').clone().html() + | ||||
'</body></html>'; | ||||
w.document.open(); | ||||
w.document.write(html); | ||||
w.document.close(); | ||||
return false; | ||||
}; | ||||
Brian Granger
|
r5857 | |||
Stefan van der Walt
|
r4615 | IPython.PrintWidget = PrintWidget; | ||
Brian Granger
|
r5857 | |||
Stefan van der Walt
|
r4615 | return IPython; | ||
Brian E. Granger
|
r4625 | }(IPython)); | ||