Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var pixelRatio = require('../util/pixelRatio');
var ispot = require('../util/ispot');
var setAbsolute = require('../util/dom').setAbsolute;
var setFullSize = require('../util/dom').setFullSize;
var clearOwnProperties = require('../util/clearOwnProperties');
var debug = typeof MARZIPANODEBUG !== 'undefined' && MARZIPANODEBUG.webGl;
// Browser-specific workarounds.
var browserQuirks = {
// Whether to use texImage2D instead of texSubImage2D when repainting an
// existing texture from a video element. On most browsers texSubImage2D is
// faster, but on Chrome the performance degrades significantly. See:
// https://bugs.chromium.org/p/chromium/issues/detail?id=612542
videoUseTexImage2D: browser.chrome
};
function initWebGlContext(canvas, opts) {
var options = {
alpha: true,
premultipliedAlpha: true,
antialias: !!(opts && opts.antialias),
preserveDrawingBuffer: !!(opts && opts.preserveDrawingBuffer)
};
if (debug && typeof WebGLDebugUtils !== 'undefined') {
console.log('Using WebGL lost context simulator');
canvas = WebGLDebugUtils.makeLostContextSimulatingCanvas(canvas);
}
_click (e) {
React.findDOMNode(this.refs.fileSelect).value = null;
e.stopPropagation();
if (!bowser.chrome) {
let chromeMessage = (
<span>This is a Google Chrome only feature. <a href="http://www.google.com/chrome/">Please consider using Chrome as your browser</a>.</span>
);
e.preventDefault();
notifications.createAlert({
type: 'Error',
message: chromeMessage
});
}
if (this.state.uploadStatus === 'uploading') {
e.preventDefault();
notifications.createAlert({
type: 'Warning',
message: 'You may only upload one dataset at a time. Please wait for the current upload to finish, then try resuming again.'
});
}
const debugParam = getParameter("debug")
const screenParam = getParameter("screen")
const resetPreferenceParam = getParameter("resetpref")
const forceCompatibilityWarningParam = getParameter("forcecompat")
this.serverUrl = serverUrlParam ? serverUrlParam : "http://circularrhythm.github.io/OfficialMusicServer"
this.debug = debugParam == "true"
this.musicList = null
this.localMusicList = []
this.localFileList = new Map()
this.preference = null
if(resetPreferenceParam) window.localStorage.removeItem("preference")
this.compatibilityWarning = []
if(!Bowser.chrome) this.compatibilityWarning.push("Incompatible browser is detected. Currently only Google Chrome is supported. The game may not work correctly in other browsers.")
if(Bowser.mobile && !Bowser.tablet) this.compatibilityWarning.push("Smartphone is detected. Playing this game with smartphones is discouraged.")
this.screenManager = new ScreenManager(this)
if(this.debug) {
if(forceCompatibilityWarningParam == "true") {
this.compatibilityWarning.push("Compatibility warning by debug parameter 1")
this.compatibilityWarning.push("Compatibility warning by debug parameter 2")
this.compatibilityWarning.push("Compatibility warning by debug parameter 3")
}
const testBmsonSetConfig = {
title: "TyTLE",
subtitle: "sub",
artist: "aRtjst",
subartists: ["sub"],
genre: "tesTgenre",
getBrowser(): Browser {
if (bowser.chrome) {
return Browser.Chrome;
} else if (bowser.firefox) {
return Browser.Firefox;
} else if (bowser.opera) {
return Browser.Opera;
} else if (bowser.msedge) {
return Browser.Edge;
} else if (bowser.safari) {
return Browser.Safari;
} else {
return Browser.Other;
}
},
isMobileOperatingSystem(): boolean {
document.queryCommandSupported = function(cmd) {
if (cmd === 'copy' || cmd === 'cut') {
if (bowser.chrome) {
if (bowser.version >= 43) {
return true;
}
return false;
}
if (bowser.opera) {
if (bowser.version >= 30) {
return true;
}
return false;
}
if (bowser.firefox && bowser.version < 41) {
render () {
let pageClasses = ' ';
let routes = this.getRoutes();
for (let route of routes) { pageClasses += route.name + ' '; }
let is_front = this.isActive('signIn');
return (
<div>
{!bowser.chrome ? : null }
<div>
<div>
<div>
</div>
</div>
</div>
</div>
);
}