Skip to content
Snippets Groups Projects
Unverified Commit 7ceaeba3 authored by juan-bobo's avatar juan-bobo Committed by GitHub
Browse files

Merge pull request #508 from mozilla/enable-media-tools-2

Enable media tools by default
parents 76adbab3 203ea7a9
No related branches found
No related tags found
No related merge requests found
...@@ -309,38 +309,36 @@ const onReady = async () => { ...@@ -309,38 +309,36 @@ const onReady = async () => {
spawnMediaInfrontOfPlayer(e.detail); spawnMediaInfrontOfPlayer(e.detail);
}); });
if (qsTruthy("mediaTools")) { document.addEventListener("paste", e => {
document.addEventListener("paste", e => { if (e.target.nodeName === "INPUT") return;
if (e.target.nodeName === "INPUT") return;
const url = e.clipboardData.getData("text");
const url = e.clipboardData.getData("text"); const files = e.clipboardData.files && e.clipboardData.files;
const files = e.clipboardData.files && e.clipboardData.files; if (url) {
if (url) { spawnMediaInfrontOfPlayer(url);
spawnMediaInfrontOfPlayer(url); } else {
} else { for (const file of files) {
for (const file of files) { spawnMediaInfrontOfPlayer(file);
spawnMediaInfrontOfPlayer(file);
}
} }
}); }
});
document.addEventListener("dragover", e => { document.addEventListener("dragover", e => {
e.preventDefault(); e.preventDefault();
}); });
document.addEventListener("drop", e => { document.addEventListener("drop", e => {
e.preventDefault(); e.preventDefault();
const url = e.dataTransfer.getData("url"); const url = e.dataTransfer.getData("url");
const files = e.dataTransfer.files; const files = e.dataTransfer.files;
if (url) { if (url) {
spawnMediaInfrontOfPlayer(url); spawnMediaInfrontOfPlayer(url);
} else { } else {
for (const file of files) { for (const file of files) {
spawnMediaInfrontOfPlayer(file); spawnMediaInfrontOfPlayer(file);
}
} }
}); }
} });
if (!qsTruthy("offline")) { if (!qsTruthy("offline")) {
document.body.addEventListener("connected", () => { document.body.addEventListener("connected", () => {
......
...@@ -3,7 +3,6 @@ import PropTypes from "prop-types"; ...@@ -3,7 +3,6 @@ import PropTypes from "prop-types";
import cx from "classnames"; import cx from "classnames";
import styles from "../assets/stylesheets/2d-hud.scss"; import styles from "../assets/stylesheets/2d-hud.scss";
import qsTruthy from "../utils/qs_truthy";
const TopHUD = ({ muted, frozen, spacebubble, onToggleMute, onToggleFreeze, onToggleSpaceBubble }) => ( const TopHUD = ({ muted, frozen, spacebubble, onToggleMute, onToggleFreeze, onToggleSpaceBubble }) => (
<div className={cx(styles.container, styles.top)}> <div className={cx(styles.container, styles.top)}>
...@@ -40,13 +39,11 @@ TopHUD.propTypes = { ...@@ -40,13 +39,11 @@ TopHUD.propTypes = {
const BottomHUD = ({ onCreateObject }) => ( const BottomHUD = ({ onCreateObject }) => (
<div className={cx(styles.container, styles.bottom)}> <div className={cx(styles.container, styles.bottom)}>
{qsTruthy("mediaTools") && ( <div
<div className={cx("ui-interactive", styles.iconButton, styles.large, styles.createObject)}
className={cx("ui-interactive", styles.iconButton, styles.large, styles.createObject)} title={"Create Object"}
title={"Create Object"} onClick={onCreateObject}
onClick={onCreateObject} />
/>
)}
</div> </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