aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-05-21 05:50:39 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-05-21 05:50:39 -0400
commiteba9b167d1fa9f5638d75a35406577f6df5297d3 (patch)
tree1a9eabb9ee8aec3c0b1637d5540c21d5a88b86c9 /src/Utils.ts
parentc91a87d8e324089166373ec828f101836555585a (diff)
parent505676028698f22e46854fdd8ea25ea3118b5d6f (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 24878a368..611c61135 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -39,6 +39,19 @@ export class Utils {
document.body.removeChild(textArea);
}
+ public static GetClipboardText(): string {
+ var textArea = document.createElement("textarea");
+ document.body.appendChild(textArea);
+ textArea.focus();
+ textArea.select();
+
+ try { document.execCommand('paste'); } catch (err) { }
+
+ const val = textArea.value;
+ document.body.removeChild(textArea);
+ return val;
+ }
+
public static loggingEnabled: Boolean = false;
public static logFilter: number | undefined = undefined;
private static log(prefix: string, messageName: string, message: any, receiving: boolean) {