mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Added clipboard_paste.js
This commit is contained in:
parent
74b6fde198
commit
fb84d17b2a
7
src/js/core/clipboard_paste.js
Normal file
7
src/js/core/clipboard_paste.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @returns {Promise<string>}
|
||||||
|
*/
|
||||||
|
export async function paste() {
|
||||||
|
/* TODO: Add fallback method */
|
||||||
|
return navigator.clipboard.readText();
|
||||||
|
}
|
@ -13,6 +13,7 @@ import { BaseHUDPart } from "../base_hud_part";
|
|||||||
import { Entity } from "../../entity";
|
import { Entity } from "../../entity";
|
||||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||||
import { globalConfig } from "../../../core/config";
|
import { globalConfig } from "../../../core/config";
|
||||||
|
import { paste } from "../../../core/clipboard_paste";
|
||||||
|
|
||||||
const copy = require("clipboard-copy");
|
const copy = require("clipboard-copy");
|
||||||
|
|
||||||
@ -246,13 +247,3 @@ export class HUDBlueprintPlacer extends BaseHUDPart {
|
|||||||
return Blueprint.deserialize(this.root, json);
|
return Blueprint.deserialize(this.root, json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Move this to a module */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {Promise<string>}
|
|
||||||
*/
|
|
||||||
async function paste() {
|
|
||||||
/* TODO: Add fallback method */
|
|
||||||
return navigator.clipboard.readText();
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user