iya-sts
    Preparing search index...

    Copying text from a page. A static utility class.

    Index
    SAID_MS: 1500

    How long a button says what happened, in milliseconds.

    • Copies text: the clipboard where the browser has one, the fallback where it has none or refuses.

      Parameters

      • doc: any

        the document

      • nav: any

        the navigator

      • text: string

        the text

      Returns Promise<boolean>

      the promise of whether it was copied

    • Copies a button's text and says on the button what happened, for SAID_MS; a failure also says, as the button's title, what to do.

      Parameters

      • doc: any

        the document

      • nav: any

        the navigator

      • t: any

        the page's translator, or null

      • button: any

        the button pressed

      • text: string

        the text

      • Optionallater: any

        optional; setTimeout, or a stand-in

      Returns Promise<boolean>

      the promise of whether it was copied

    • Copies through a selected, hidden text area and execCommand('copy').

      Parameters

      • doc: any

        the document

      • text: string

        the text

      Returns boolean

      whether the browser said it copied

    • What a button says after a copy, in the page's language.

      Parameters

      • t: any

        the page's translator, or null

      • ok: boolean

        whether it copied

      Returns any

      { label, hint }: the button's words, and for a failure what to do instead ('' for a success)