Variable aclControlConst

aclControl: {
    ACLControlBox5: ((subject, context, noun, kb) => HTMLElement);
    preventBrowserDropEvents: ((document) => void);
    shortNameForFolder: ((x) => string);
} = ...

Type declaration

  • ACLControlBox5: ((subject, context, noun, kb) => HTMLElement)
  • preventBrowserDropEvents: ((document) => void)
      • (document): void
      • See https://coshx.com/preventing-drag-and-drop-disasters-with-a-chrome-userscript Without this dropping anything onto a browser page will cause chrome etc to jump to diff page throwing away all the user's work.

        In apps which may use drag and drop, this utility takes care of the fact by default in a browser, an uncaught user drop into a browser window causes the browser to lose all its work in that window and navigate to another page

        Parameters

        • document: HTMLDocument

          The DOM

        Returns void

        void

  • shortNameForFolder: ((x) => string)
      • (x): string
      • Get a folder's own filename in the directory tree. Also works for domain names; the URL protocol ('https://') acts as the tree root with short name '/' (see also test/unit/acl/acl-control.test.ts).

        shortNameForFolder($rdf.namedNode('http://example.com/some/folder/'))
        // 'folder'

        shortNameForFolder($rdf.namedNode('http://example.com/some/folder'))
        // 'folder'

        shortNameForFolder($rdf.namedNode('http://example.com/'))
        // 'example.com'

        shortNameForFolder($rdf.namedNode('http://example.com'))
        // 'example.com'

        shortNameForFolder($rdf.namedNode('http://'))
        // '/'

        It also works with relative URLs:

        shortNameForFolder($rdf.namedNode('../folder/'))
        // 'folder'

        Parameters

        Returns string

        Short name for the folder

Generated using TypeDoc