From 203ea7a9a26aebddd5827798ca890d5b72767b64 Mon Sep 17 00:00:00 2001 From: johnshaughnessy <johnfshaughnessy@gmail.com> Date: Wed, 8 Aug 2018 17:06:02 -0700 Subject: [PATCH] Enable media tools by default --- src/hub.js | 54 ++++++++++++++++------------------ src/react-components/2d-hud.js | 13 ++++---- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/hub.js b/src/hub.js index db26ba4d3..665c90e2d 100644 --- a/src/hub.js +++ b/src/hub.js @@ -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", () => { diff --git a/src/react-components/2d-hud.js b/src/react-components/2d-hud.js index 8bcec6c71..15168e999 100644 --- a/src/react-components/2d-hud.js +++ b/src/react-components/2d-hud.js @@ -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> ); -- GitLab