Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
import 'react-fastclick';
import 'webrtc-adapter';
import 'buffer';
import { analytics } from 'meteor/okgrow:analytics';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import Browser from 'bowser';
import injectTapEventPlugin from 'react-tap-event-plugin';
import React from 'react';
import * as config from '../lib/config';
import Root from './components/root.component';
import Electron from './utils/electron.utils';
Browser.mac = /(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/
.test(navigator.userAgent) && !Browser.ios;
Browser.electron = Electron.isDesktop();
injectTapEventPlugin();
Meteor.startup(() => {
if (Meteor.isDevelopment) {
analytics.debug(); // show the analytics debug log if testing locally
}
render(
,
document.getElementById('root'),
);
document.title = config.APP_NAME; // set the title for the app
const checkDevicePixelRatio = () => window.devicePixelRatio;
const checkFacebook = () => /fban|fbav/.test(ua);
const checkTwitter = () => /twitter/.test(ua);
const checkInstagram = () => /instagram/.test(ua);
const checkPinterest = () => /pinterest/.test(ua);
// Bot flags
const isBot = checkBot();
// OS flags
const isiOS = bowser.ios === true;
const isAndroid = bowser.android === true;
const isFirefoxOS = bowser.firefoxos === true;
const isWindowsPhone = bowser.windowsphone === true;
const isBlackberry = bowser.blackberry === true;
const isMac = bowser.mac === true;
const isWindows = bowser.windows === true;
const isLinux = bowser.linux === true;
const isChromeOS = bowser.chromeos === true;
// Device flags
const isPhone = bowser.mobile === true;
const isTablet = bowser.tablet === true;
const isMobile = isPhone || isTablet;
const isDesktop = !isMobile;
const isiPhone = isiOS && bowser.iphone === true;
const isiPad = isiOS && bowser.ipad === true;
const isiPod = isiOS && bowser.ipod === true;
// Browser flags
const isChrome = bowser.chrome === true;
const isFirefox = bowser.firefox === true;
/*global System*/
import { Rectangle, Color } from "lively.graphics";
import bowser from "bowser";
const isMac = !!bowser.mac;
if (typeof $world !== "undefined") {
$world.withAllSubmorphsDo(ea =>
ea.hasOwnProperty("_cachedKeyhandlers") && (ea._cachedKeyhandlers = null));
}
function parseURLQuery() {
if (typeof document === "undefined" || !document.location) return {};
var search = (document.location.hash || document.location.search).slice(1),
args = search && search.split("&"),
options = {};
if (args) for (var i = 0; i < args.length; i++) {
var keyAndVal = args[i].split("="),
key = keyAndVal[0],
val = true;
if (keyAndVal.length > 1) {
Browser = require('bowser');
Browser.mac = /(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/
.test(navigator.userAgent) && !Browser.ios;
Browser.electron = Electron.isDesktop();
TagsInput = require('react-tagsinput');
require('webrtc-adapter-test');
ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
ReactScrollComponents = require('react-scroll-components');
Q = require('q');
injectTapEventPlugin();
Meteor.startup(function() {
if (WebAppCordova) {
var fileUrlRegEx = /^file:\/\/(.*)/;
WebAppCordova.localFileSystemUrl = function(fileUrl) {
var match = fileUrlRegEx.exec(fileUrl);
if (!match) return fileUrl;
isCommandKey() {
var domEvt = this.domEvt;
if (!domEvt) return false;
var isCmd = false;
if (!bowser.mac)
isCmd = isCmd || domEvt.ctrlKey;
if (bowser.tablet || bowser.tablet)
isCmd = isCmd || false/*FIXME!*/
return isCmd || domEvt.metaKey || domEvt.keyIdentifier === 'Meta';
}
getOperatingSystem(): OperatingSystem {
if (bowser.android) {
return OperatingSystem.Android;
} else if (bowser.ios) {
return OperatingSystem.iOS;
} else if (bowser.mac) {
return OperatingSystem.Mac;
} else if (bowser.windows) {
return OperatingSystem.Windows;
} else if (bowser.windowsphone) {
return OperatingSystem.WindowsPhone;
} else if (bowser.linux) {
return OperatingSystem.Linux;
} else {
return OperatingSystem.Other;
}
},
getProviderType(provider: ZeroExProvider): ProviderType | undefined {
export const NotSupportedErrorComponent = ({action})=> {
return (
<div style="{[styles.general.css]}">
<div>
<img style="{[styles.general.icon.css]}/" src="/images/astronaut.png">
<p>{`Sorry, we do not currently support your browser.`}</p>
<p>You can download <a href="https://www.google.com/chrome/">Google Chrome</a> or <a href="https://www.mozilla.org/firefox">Mozilla Firefox</a> for free to use this video chatroom.</p>
<br>
{(Browser.mac && !Browser.electron) ?
: ''}
<br>
</div>
</div>
);
};
NotSupportedErrorComponent.propTypes ={
: ''
}
<div style="{[GlobalStyles.stickyFooterPage]}">
<div>
<div>
<h1 style="{[styles.title.css]}">{APP_NAME}</h1>
<br>
<br>
{(Browser.mac && !Browser.electron) ?
: ''}
</div>
</div>
</div>
);
}
}
getOperatingSystem(): OperatingSystemType {
if (bowser.android) {
return OperatingSystemType.Android;
} else if (bowser.ios) {
return OperatingSystemType.iOS;
} else if (bowser.mac) {
return OperatingSystemType.Mac;
} else if (bowser.windows) {
return OperatingSystemType.Windows;
} else if (bowser.windowsphone) {
return OperatingSystemType.WindowsPhone;
} else if (bowser.linux) {
return OperatingSystemType.Linux;
} else {
return OperatingSystemType.Other;
}
},
isTokenTracked(token: Token): boolean {
isCommandKey(domEvt) {
var isCmd = false;
if (!bowser.mac)
isCmd = isCmd || domEvt.ctrlKey;
if (bowser.tablet || bowser.tablet)
isCmd = isCmd || false/*FIXME!*/
return isCmd || domEvt.metaKey || domEvt.keyIdentifier === 'Meta';
},
isShiftDown(domEvt) { return !!domEvt.shiftKey },