Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
document.addEventListener("keydown", (event) => {
const keyName = event.key
switch (keyName) {
case 'Spacebar':
// disable scrolling on press Spacebar
log.debug('SPACEBAR target: ' + event.target);
if (event.target == document.body) { log.debug('HEY SPACEBAR!'); event.preventDefault(); };
case ' ':
togglePlayback();
break;
case 'p':
pressPlay();
break;
case 's':
pressStop();
break
}}, );
}
.then((classPath: string) => {
this.cfg.initCfg.classPath = classPath;
// Push the user-defined java archive file to the runtime service.
if (javaArchive) {
this.cfg.documentService.setLibraryToService(docBody, async(success) => {
if (success) {
await this.cfg.fieldActionService.fetchFieldActions()
.catch((error: any) => {
this.handleError(error);
});
}
});
} else {
log.debug(`Fetching user document: name=${docdef.name}, id=${docdef.id},\
isSource=${docdef.initModel.isSource}, inspection=${docdef.initModel.inspectionType}`);
this.cfg.documentService.fetchDocument(docdef, this.cfg.initCfg.classPath).toPromise()
.then(async(doc: DocumentDefinition) => {
if (doc.fields.length === 0) {
if (isSource) {
DataMapperUtil.removeItemFromArray(docdef, this.cfg.sourceDocs);
} else {
DataMapperUtil.removeItemFromArray(docdef, this.cfg.targetDocs);
}
}
log.debug(`Fetched user document: name=${docdef.name}, id=${docdef.id},\
isSource=${docdef.initModel.isSource}, inspection=${docdef.initModel.inspectionType}`);
this.updateStatus();
})
.catch((error: any) => {
quitLightbox() {
log.debug('quitLightbox');
if (this.image === null) return;
CSSUtil.setTransitionProperty(this.image, 'opacity '+this.options.animationSpeed/1000+'s linear');
setTimeout(() => {
// without timeout it's to fast to make it fade and just jumps to 1 instant
this.image.style.opacity = 0;
}, 5);
setTimeout(() => {
this.removeImage();
this.inProgress = false;
this.onEndListeners.forEach(l => l());
}, this.options.animationSpeed);
return new Promise((resolve) => {
if (this.options.useCache && this.cacheProvider.exists(state.href)) {
log.debug('📎 Use cache-provider for: ' + state.href)
resolve(this._onDataLoaded(this.cacheProvider.fetch(state.href), state))
} else {
this.currentRequest = $.ajax({
url: state.href,
dataType: 'html',
headers: {
// Send header to allow backends to
// send partial response for saving
// bandwidth and process time
'X-Allow-Partial': 1
},
// Need to disable cache to prevent
// browser to serve partial when no
// ajax context is defined.
cache: false,
type: 'get',
incrementSdkLoadCount();
if (getSdkLoadCount() > 1) {
log.warn(`OneSignal: The web push SDK is included more than once. For optimal performance, please include our ` +
`SDK only once on your page.`);
log.debug(`OneSignal: Exiting from SDK initialization to prevent double-initialization errors. ` +
`Occurred ${getSdkLoadCount()} times.`);
} else {
// We're running in the host page, iFrame of the host page, or popup window
// Load OneSignal's web SDK
if (typeof OneSignal !== "undefined")
var predefinedOneSignalPushes = OneSignal;
if (isPushNotificationsSupported()) {
(window as any).OneSignal = require('./OneSignal').default;
} else {
log.debug('OneSignal: Push notifications are not supported. A stubbed version of the SDK will be initialized.');
(window as any).OneSignal = require('./OneSignalStub').default;
}
if (predefinedOneSignalPushes)
for (var i = 0; i < predefinedOneSignalPushes.length; i++)
OneSignal.push(predefinedOneSignalPushes[i]);
}
}
else if (SdkEnvironment.getWindowEnv() === WindowEnvironmentKind.ServiceWorker) {
// We're running as the service worker
(self as any).OneSignal = require('./service-worker/ServiceWorker').default;
}
}
For sites that omit autoRegister, autoRegister is assumed to be true. For Safari, the session count
and last active is updated from this registration call.
*/
InitHelper.sessionInit({ __sdkCall: true });
}
});
}
if (SubscriptionHelper.isUsingSubscriptionWorkaround() && context.sessionManager.isFirstPageView()) {
/*
The user is on an HTTP site and they accessed this site by opening a new window or tab (starting a new
session). This means we should increment their session_count and last_active by calling
registerWithOneSignal(). Without this call, the user's session and last_active is not updated. We only
do this if the user is actually registered with OneSignal though.
*/
log.debug(`(${SdkEnvironment.getWindowEnv().toString()}) Updating session info for HTTP site.`);
const isPushEnabled = await OneSignal.isPushNotificationsEnabled();
if (isPushEnabled) {
const context: Context = OneSignal.context;
const { deviceId } = await Database.getSubscription();
OneSignalApi.updateUserSession(deviceId, new PushDeviceRecord(null));
}
}
InitHelper.updateEmailSessionCount();
OneSignal.context.cookieSyncer.install();
InitHelper.showPromptsFromWebConfigEditor();
}
useEffect(() => {
log.debug('Revert modal effect handler: ', defaultButtonRef.current);
if (defaultButtonRef.current) {
defaultButtonRef.current.focus();
}
}, []);
const fileName = `${options.fileName}${production ? ".min" : ""}.css`;
const srcFile = path.join(scssDist, stylesScss);
const outFile = path.join(cssDist, fileName);
const sourceMapFile = `${outFile}.map`;
if (!isMultiCompile || !loggedOnce) {
loggedOnce = true;
log.info("Compiling the main css bundle.");
}
await fs.ensureDir(cssDist);
if (!production) {
log.debug("Compiling a development css bundle along with a sourcemap to:");
log.debug(list([outFile, sourceMapFile]));
log.debug("");
} else {
log.debug("Compiling a production css bundle to:");
log.debug(list([outFile]));
log.debug("");
}
const unmodifiedCSS = compileScss({
file: data ? undefined : srcFile,
data,
outFile,
sourceMap: !production,
outputStyle: "expanded",
}).css.toString();
const { css, map } = await postcss(unmodifiedCSS, {
production,
srcFile,
outFile,
buildImageFn(img, process.cwd()).then(function() {
log.debug('starting push');
pushImageFn(img, host + ":" + registryPort).then(function(data) {
log.debug('push successful');
defer.resolve(data);
}, function(err) {
log.error('Error pushing: ' + err);
defer.reject(err);
})
}, function(err) {
log.error('Error building: ' + err);
this.openContinuousDynamicExpression = continuousDynamicExpression;
this.getMultiExpression.StartingContinuousDynamic = continuousDynamicExpression;
continuousDynamicExpression.StartMultiExpression = this.getMultiExpression;
if (this.activeInstantaneousDynamic !== undefined &&
this.activeInstantaneousDynamic.StaffNumber === continuousDynamicExpression.StaffNumber) {
this.activeInstantaneousDynamic = undefined;
}
} else if (type === "stop") {
if (this.openContinuousDynamicExpression !== undefined) {
this.closeOpenContinuousDynamic();
}
}
} catch (ex) {
const errorMsg: string = "ReaderErrorMessages/WedgeError" + ", Error while reading Crescendo / Diminuendo.";
this.musicSheet.SheetErrors.pushMeasureError(errorMsg);
log.debug("ExpressionReader.addWedge", errorMsg, ex);
}
}
}
private fillMultiOrTempoExpression(inputString: string, currentMeasure: SourceMeasure): void {