Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_getPlatform() {
const ua = window.navigator.userAgent
const md = new MobileDetect(ua);
client.platform.isMobile = (md.mobile() !== null); // true if phone or tablet
client.platform.os = (() => {
let os = md.os();
if (os === 'AndroidOS') {
return 'android';
} else if (os === 'iOS') {
return 'ios';
} else {
return 'other';
}
})();
}
_definePlatform() {
const ua = window.navigator.userAgent
const md = new MobileDetect(ua);
client.platform.isMobile = (md.mobile() !== null); // true if phone or tablet
client.platform.os = (function() {
const os = md.os();
if (os === 'AndroidOS')
return 'android';
else if (os === 'iOS')
return 'ios';
else
return 'other';
})();
}
}
function Sniffer (...opts) {
this.classes = ''
this.debug = (opts[0].debug)
this.embedded = false
this._mobileSniffer = new MobileDetect(window.navigator.userAgent)
}
const getMedia = (userAgent: string, userAgentDevice: string) => {
const isAtSmallUp = true;
let isMobile = true;
let isTablet = false;
if (userAgentDevice) {
isMobile =
userAgentDevice === 'smartphone' ||
userAgentDevice === 'mobilebot' ||
userAgentDevice === 'mobile';
isTablet = userAgentDevice === 'tablet';
} else {
const mobileDetect = new MobileDetect(userAgent);
isMobile = Boolean(mobileDetect.phone());
isTablet = Boolean(mobileDetect.tablet());
}
return {
isAtSmallUp,
isAtMediumUp: isTablet || !isMobile,
isAtLargeUp: !isMobile && !isTablet,
};
};
render() {
const argState = this.accessor.getQueryObject();
let { focusedInput, startDate, endDate, initialVisibleMonth } = this.state;
/**
* These functions can return null so check for bool true.
*/
const md = new MobileDetect(window.navigator.userAgent);
const isMobile = md.mobile() || md.phone();
const numberOfMonths = isMobile ? 1 : 2;
if (this.noArgs && argState[this.props.id] !== undefined && Object.keys(argState[this.props.id]).length > 0) {
if (typeof argState[this.props.id].min !== undefined) {
startDate = moment(argState[this.props.id].min)
initialVisibleMonth = () => startDate
}
endDate = (typeof argState[this.props.id].max !== undefined) ? moment(argState[this.props.id].max) : null
}
return (
<div>
</div>
created() {
var md = new MobileDetect(window.navigator.userAgent);
this.$store.state.mobile = md.mobile();
}
}
skyboxContainer2RotZ: 175, //ajust X value to rotate sky into position according to long
skyboxRotX: 54,
skyboxRotY: 326,
skyboxRotZ: 347
};
var defaultWaterSide = THREE.FrontSide;
var debugOn = false;
var pointClouds = [];
var spriteContainer;
var md = new MobileDetect(window.navigator.userAgent);
var androidVersion = md.versionStr('Android');
var iOSVersion = md.versionStr('iOS')
var oldAndroid = (androidVersion !== null && cmpVersions(androidVersion,'5', '.') < 0);
var oldIOS = (iOSVersion !== null && cmpVersions(iOSVersion,'9', '_') < 0);
var canHandleOrientation = false;
(function() {
var originalGetExtensionFunction = WebGLRenderingContext.prototype.getExtension;
componentDidMount() {
let userAgent = window.navigator.userAgent;
let mobile = new MobileDetect(userAgent);
this.setState({isMobile: (mobile.phone() !== null ) ? true : false});
}
isMobile() {
return !!new MobileDetect(window.navigator.userAgent).mobile();
}
export const isMobile = () => {
const ua = window && window.navigator && window.navigator.userAgent;
const md = ua ? new MobileDetect(ua) : null;
return md && md.mobile() !== null;
};