Commit 1f7174f6 authored by Robert Knight's avatar Robert Knight

Convert Guest class to JS

parent 70693ddf
This diff is collapsed.
This diff is collapsed.
// TODO - Convert this to an ES import once the `Guest` class is converted to JS.
// @ts-expect-error
const Guest = require('./guest');
import Guest from './guest';
export default class Host extends Guest {
constructor(element, config) {
......
......@@ -20,19 +20,18 @@ import iconSet from './icons';
registerIcons(iconSet);
import configFrom from './config/index';
import PdfSidebar from './pdf-sidebar';
import CrossFramePlugin from './plugin/cross-frame';
import DocumentPlugin from './plugin/document';
import Guest from './guest';
import PdfSidebar from './pdf-sidebar';
import Sidebar from './sidebar';
// Modules that are still written in CoffeeScript and need to be converted to
// JS.
// @ts-expect-error
import Guest from './guest';
// @ts-expect-error
import BucketBarPlugin from './plugin/bucket-bar';
import CrossFramePlugin from './plugin/cross-frame';
// @ts-expect-error
import PDFPlugin from './plugin/pdf';
import Sidebar from './sidebar';
const pluginClasses = {
// UI plugins
......@@ -59,6 +58,7 @@ const config = configFrom(window);
$.noConflict(true)(function () {
const isPDF = typeof window_.PDFViewerApplication !== 'undefined';
/** @type {new (e: Element, config: any) => Guest} */
let Klass = isPDF ? PdfSidebar : Sidebar;
if (config.subFrameIdentifier) {
......
......@@ -5,7 +5,7 @@ Plugin = require('../plugin')
{ default: Delegator } = require('../delegator')
$ = require('jquery')
Guest = require('../guest')
{ default: Guest } = require('../guest')
{ $imports } = require('../guest')
rangeUtil = null
selections = null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment