* @target web
()
| 332 | * @target web |
| 333 | */ |
| 334 | private static _registerJQueryPlugin(): void { |
| 335 | if (!Environment.isRunningInWorker && Environment.globalThis && 'jQuery' in Environment.globalThis) { |
| 336 | const jquery: any = Environment.globalThis.jQuery; |
| 337 | const api: JQueryAlphaTab = new JQueryAlphaTab(); |
| 338 | jquery.fn.alphaTab = function (this: any, method: string) { |
| 339 | // biome-ignore lint/complexity/noArguments: Legacy jQuery plugin argument forwarding |
| 340 | const args = Array.prototype.slice.call(arguments, 1); |
| 341 | // if only a single element is affected, we use this |
| 342 | if (this.length === 1) { |
| 343 | return api.exec(this[0], method, args); |
| 344 | } |
| 345 | // if multiple elements are affected we provide chaining |
| 346 | return this.each((_i: number, e: HTMLElement) => { |
| 347 | api.exec(e, method, args); |
| 348 | }); |
| 349 | }; |
| 350 | jquery.alphaTab = { |
| 351 | restore: JQueryAlphaTab.restore |
| 352 | }; |
| 353 | jquery.fn.alphaTab.fn = api; |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | public static readonly renderEngines: Map<string, RenderEngineFactory> = Environment._createDefaultRenderEngines(); |
| 358 |