瀏覽代碼

Rename printd function to printWidget

Saul Shanabrook 6 年之前
父節點
當前提交
7838425743

+ 5 - 3
packages/apputils/src/printing.ts

@@ -4,14 +4,16 @@
  * If you have a custom widget and would like to make it printable, then you
  * should fulfil that interface on that widget by adding a `[printSymbol]` method.
  *
- * One way of printing is to use the `printd` function, which creates a hidden iframe
+ * One way of printing is to use the `printWidget` function, which creates a hidden iframe
  * and copies the DOM nodes from your widget to that iframe and printing just that iframe.
  *
- * To use this method in your widget, set the `[printSymbol]` method to `printd`.
+ * To use this method in your widget, set the `[printSymbol]` method to `printWidget`.
  * You can also provide custom args to that function, including CSS text to apply
  * when printing.
  *
  * See https://github.com/joseluisq/printd#print
+ *
+ * Another way to print is to use the `printURL` function, which takes a URL and prints that page.
  */
 
 import { Printd, PrintdCallback } from 'printd';
@@ -69,7 +71,7 @@ const _PRINTD = new Printd();
  * use the `printd` library to print the node, by
  * creating an iframe and copying the DOM into it.
  */
-export function printd(
+export function printWidget(
   this: Widget,
   cssText?: string,
   callback?: PrintdCallback

+ 2 - 2
packages/imageviewer/src/widget.ts

@@ -3,7 +3,7 @@
 
 import { PathExt } from '@jupyterlab/coreutils';
 
-import { printSymbol, printd } from '@jupyterlab/apputils';
+import { printSymbol, printWidget } from '@jupyterlab/apputils';
 
 import {
   ABCWidgetFactory,
@@ -68,7 +68,7 @@ export class ImageViewer extends Widget {
   /**
    * Print in iframe.
    */
-  [printSymbol] = printd;
+  [printSymbol] = printWidget;
 
   /**
    * The image widget's context.

+ 1 - 1
packages/inspector/src/inspector.ts

@@ -103,7 +103,7 @@ export class InspectorPanel extends Panel implements IInspector {
    * Print in iframe
    */
   [printSymbol]() {
-    printd.bind(this)('.p-mod-hidden {display: none;}');
+    printWidget.bind(this)('.p-mod-hidden {display: none;}');
   }
 
   /**

+ 2 - 2
packages/json-extension/src/index.tsx

@@ -3,7 +3,7 @@
 
 import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
 
-import { printSymbol, printd } from '@jupyterlab/apputils';
+import { printSymbol, printWidget } from '@jupyterlab/apputils';
 
 import { Message } from '@phosphor/messaging';
 
@@ -42,7 +42,7 @@ export class RenderedJSON extends Widget implements IRenderMime.IRenderer {
     this._mimeType = options.mimeType;
   }
 
-  [printSymbol] = printd;
+  [printSymbol] = printWidget;
 
   /**
    * Render JSON into this widget's node.