Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? getSelection({
state,
windowType: props.parentWindowType,
viewId: props.parentDefaultViewId,
})
: NO_SELECTION,
modal: state.windowHandler.modal,
});
const NO_SELECTION = [];
const NO_VIEW = {};
const PANEL_WIDTHS = ['1', '.2', '4'];
const GEO_PANEL_STATES = ['grid', 'all', 'map'];
// for mobile devices we only want to show either map or grid
if (currentDevice.type === 'mobile' || currentDevice.type === 'tablet') {
GEO_PANEL_STATES.splice(1, 1);
}
const filtersToMap = function(filtersArray) {
let filtersMap = Map();
if (filtersArray && filtersArray.length) {
filtersArray.forEach(filter => {
filtersMap = filtersMap.set(filter.filterId, filter);
});
}
return filtersMap;
};
const doesSelectionExist = function({
data,
constructor(props) {
super(props);
const { defaultViewId, defaultPage, defaultSort } = props;
this.pageLength =
currentDevice.type === 'mobile' || currentDevice.type === 'tablet'
? 9999
: 100;
this.supportAttribute = false;
this.state = {
data: null, // view result (result, firstRow, pageLength etc)
layout: null,
pageColumnInfosByFieldName: null,
toggleWidth: 0,
viewId: defaultViewId,
page: defaultPage || 1,
sort: defaultSort,
filtersActive: Map(),
initialValuesNulled: Map(),
clickOutsideLock: true,
isShowIncluded: false,
// 播放视频广告
playVideoAd () {
this.setAdInterval()
this.player.play()
}
// 暂停视频广告
pauseVideoAd () {
this.clearAdInterval()
this.player.pause()
}
}
let defaultComponent = VideoAdComponent
if (device.mobile()) {
defaultComponent = MbVideoAdComponent
}
export default defaultComponent
const existingScriptEl = document.querySelector(
'script[src="cordova.js"]',
);
if (existingScriptEl) existingScriptEl.remove();
const scriptEl = document.createElement('script');
scriptEl.setAttribute('type', 'text/javascript');
scriptEl.setAttribute('src', `${platform}/cordova.js`);
document.body.appendChild(scriptEl);
console.log(`Injected cordova.js of ${platform} platform.`);
};
if (!isWebview(navigator.userAgent)) {
injectCordovaScript('browser');
} else if (currentDevice.android()) {
injectCordovaScript('android');
} else if (currentDevice.ios()) {
injectCordovaScript('ios');
}
const deviceJs = require('current-device').default;
function bodyPrepend(platform) {
let body = document.querySelector("body"),
script = document.createElement("script");
script.onload = function () {
console.log("Cordova script loaded!");
};
script.src = `platform_cordova_files/${platform}/cordova.js`;
body.appendChild(script);
console.log(`${platform} platform cordova.js injected.`);
}
function bodyPrepend(platform) {
let body = document.querySelector("body"),
script = document.createElement("script");
script.onload = function () {
console.log("Cordova script loaded!");
};
script.src = `platform_cordova_files/${platform}/cordova.js`;
body.appendChild(script);
console.log(`${platform} platform cordova.js injected.`);
}
if (deviceJs.android())
bodyPrepend("android");
else if (deviceJs.ios())
bodyPrepend("ios");
else
bodyPrepend("browser");
script = document.createElement("script");
script.onload = function () {
console.log("Cordova script loaded!");
};
script.src = `platform_cordova_files/${platform}/cordova.js`;
body.appendChild(script);
console.log(`${platform} platform cordova.js injected.`);
}
if (deviceJs.android())
bodyPrepend("android");
else if (deviceJs.ios())
bodyPrepend("ios");
else
bodyPrepend("browser");
);
if (existingScriptEl) existingScriptEl.remove();
const scriptEl = document.createElement('script');
scriptEl.setAttribute('type', 'text/javascript');
scriptEl.setAttribute('src', `${platform}/cordova.js`);
document.body.appendChild(scriptEl);
console.log(`Injected cordova.js of ${platform} platform.`);
};
if (!isWebview(navigator.userAgent)) {
injectCordovaScript('browser');
} else if (currentDevice.android()) {
injectCordovaScript('android');
} else if (currentDevice.ios()) {
injectCordovaScript('ios');
}
constructor(props) {
super(props);
let val = 400;
if (currentDevice.type === 'mobile') {
val = 300;
}
this.width = val;
this.height = val;
}
componentDidMount() {
onClose={val => {
const value = typeof val !== 'undefined' ? val : false;
this.scanBarcode(value);
if (currentDevice.type === 'mobile') {
closeOverlay();
}
}}
/>