Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Workspace

Workspace (Drafts)

The ThoughtAsylum library includes a set of extensions to the Drafts Workspace object.

Hierarchy

  • Workspace

Index

Methods

TA_getAllWorkspaceNames

  • TA_getAllWorkspaceNames(): string[]
  • Returns an array of all Workspace names.

    // Example
    alert(Workspace.TA_getAllWorkspaceNames().join("\n"));

    Returns string[]

TA_loadWorkspaceByName

  • TA_loadWorkspaceByName(p_strWorkspaceName: string): Boolean
  • Load a workspace by name. Note that Drafts treats the search for a workspace name as case insensitive. Returns true if the workspace was successfully loaded, otherwise false.

    Parameters

    • p_strWorkspaceName: string

      the name of the workspace to load.

      // Example
      Workspace.TA_loadWorkspaceByName("work");

    Returns Boolean

TA_loadWorkspaceNext

  • TA_loadWorkspaceNext(): string
  • Load the next workspace in the list of workspaces. The function looks through the list of Drafts workspaces and tries to find the currently loaded workspace. It will then pick the naxt name in the list and load that. If it gets to the end of the list, or the current workspace could not be found, it will attempt to load the first workspace. Note that if you have only one named workspace, or no such workspaces, this function will effectively do nothing. Returns the name of the workspace loaded, or en empty string if no change was made.

    // Example
    Workspace.TA_loadWorkspaceNext();

    Returns string

TA_loadWorkspacePrevious

  • TA_loadWorkspacePrevious(): string
  • Load the previous workspace in the list of workspaces. The function looks through the list of Drafts workspaces and tries to find the currently loaded workspace. It will then pick the previous name in the list and load that. If it gets to the start of the list it will attempt to load the last workspace in the list. If the current workspace could not be found, it will attempt to load the first workspace in the list. Note that if you have only one named workspace, or no such workspaces, this function will effectively do nothing. Returns the name of the workspace loaded, or en empty string if no change was made.

    // Example
    Workspace.TA_loadWorkspacePrevious();

    Returns string

TA_selectLoadWorkspaceByButton

  • TA_selectLoadWorkspaceByButton(p_bShowDraftsList?: boolean): void
  • Prompt the user to select a workspace to load. If there are no workspaces, a warning is displayed. If there is only one workspace, it will be automatically loaded. If there is more than one workspace, the user will be prompted with a list of workspaces and may select one to load. Once the load attempt has been undertaken, the draft list will be displayed if the display parameter is set to true.

    Parameters

    • Optional p_bShowDraftsList: boolean

      Forces the display of the Drafts list at the end when true. Defaults to false.

      // Example
      Workspace.TA_selectLoadWorkspaceByButton(false);

    Returns void

TA_selectWorkspace

  • TA_selectWorkspace(p_strMessage: string): string
  • Loads a named Workspace. If there are no workspaces available, or the user cancels a selection from a multiple selection, an empty string will be returned. If there is just one workspace, the name of it will be returned. If there are two or more workspaces, the user will be presented with a list of workspace names to choose from and the selected workspace will be returned. If the user cancels, a null object is returned.

    Parameters

    • p_strMessage: string

      The text to display as a question or for information to the user if they have to select from multiple workspaces.

      // Example
      alert(Workspace.TA_selectWorkspace("You have multiple workspaces, please choose one:"));

    Returns string