Skip to content
Snippets Groups Projects
Commit 203ea7a9 authored by johnshaughnessy's avatar johnshaughnessy
Browse files

Enable media tools by default

parent 76adbab3
No related branches found
No related tags found
No related merge requests found
......@@ -309,38 +309,36 @@ const onReady = async () => {
spawnMediaInfrontOfPlayer(e.detail);
});
if (qsTruthy("mediaTools")) {
document.addEventListener("paste", e => {
if (e.target.nodeName === "INPUT") return;
const url = e.clipboardData.getData("text");
const files = e.clipboardData.files && e.clipboardData.files;
if (url) {
spawnMediaInfrontOfPlayer(url);
} else {
for (const file of files) {
spawnMediaInfrontOfPlayer(file);
}
document.addEventListener("paste", e => {
if (e.target.nodeName === "INPUT") return;
const url = e.clipboardData.getData("text");
const files = e.clipboardData.files && e.clipboardData.files;
if (url) {
spawnMediaInfrontOfPlayer(url);
} else {
for (const file of files) {
spawnMediaInfrontOfPlayer(file);
}
});
}
});
document.addEventListener("dragover", e => {
e.preventDefault();
});
document.addEventListener("dragover", e => {
e.preventDefault();
});
document.addEventListener("drop", e => {
e.preventDefault();
const url = e.dataTransfer.getData("url");
const files = e.dataTransfer.files;
if (url) {
spawnMediaInfrontOfPlayer(url);
} else {
for (const file of files) {
spawnMediaInfrontOfPlayer(file);
}
document.addEventListener("drop", e => {
e.preventDefault();
const url = e.dataTransfer.getData("url");
const files = e.dataTransfer.files;
if (url) {
spawnMediaInfrontOfPlayer(url);
} else {
for (const file of files) {
spawnMediaInfrontOfPlayer(file);
}
});
}
}
});
if (!qsTruthy("offline")) {
document.body.addEventListener("connected", () => {
......
......@@ -3,7 +3,6 @@ import PropTypes from "prop-types";
import cx from "classnames";
import styles from "../assets/stylesheets/2d-hud.scss";
import qsTruthy from "../utils/qs_truthy";
const TopHUD = ({ muted, frozen, spacebubble, onToggleMute, onToggleFreeze, onToggleSpaceBubble }) => (
<div className={cx(styles.container, styles.top)}>
......@@ -40,13 +39,11 @@ TopHUD.propTypes = {
const BottomHUD = ({ onCreateObject }) => (
<div className={cx(styles.container, styles.bottom)}>
{qsTruthy("mediaTools") && (
<div
className={cx("ui-interactive", styles.iconButton, styles.large, styles.createObject)}
title={"Create Object"}
onClick={onCreateObject}
/>
)}
<div
className={cx("ui-interactive", styles.iconButton, styles.large, styles.createObject)}
title={"Create Object"}
onClick={onCreateObject}
/>
</div>
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment