opVerbDocs

op verbs
  op.expand
    Syntax
      op.expand ()
    Params
      None.
    What it does
      Expands the bar cursor headline making all its children visible.
    Returns
      The value undefined.
    Notes
      The Frontier version of this verb takes a number param, that determines the number of levels to be expanded.
    Example
      op.expand ()
        undefined
  op.expandAllLevels
    Syntax
      op.expandAllLevels ()
    Params
      None.
    What it does
      Expands the bar cursor headline making all its children, and all their descendants, visible.
    Returns
      The value undefined.
    Example
      op.expandAllLevels ()
        undefined
  op.collapse
    Syntax
      op.collapse ()
    Params
      None.
    What it does
      Collapses the bar cursor headline making all its children not visible.
    Returns
      The value undefined.
    Example
      op.collapse ()
        undefined
  op.collapseEverything
    Syntax
      op.collapseEverything ()
    Params
      None.
    What it does
      Collapses everything in the outline and moves the bar cursor to the first summit.
    Returns
      The value undefined.
    Bug
      The bar cursor does not go to the first summit, there is no cursor after this runs.
    Example
      op.collapseEverything ()
        undefined
  op.go
    Syntax
      op.go (direction, count)
    Params
      direction is one of the directions the outliner supports: up, down, left, right, flatup, flatdown, nodirection.
      count is the number of times the cursor will move in the indicated direction.
    What it does
      It tries to move the bar cursor in the indicated directions, the indicated number of times.
        up - bar cursor moves to previous sibling
        down -- bar cursor moves to next sibling
        left -- bar cursor moves to parent
        right -- bar cursor moves to first child, expanding if necessary
        flatup -- bar cursor moves to the previous headline up from the cursor, regardless of level
        flatdown -- bar cursor moves to the next headline down from the cursor, regardless of level
    Returns
      true if it was able to move, false otherwise.
    Examples
      op.go (left, 1)
        true
      op.go (flatdown, 1)
        true
      op.go (down, 1)
        false
  op.firstSummit
    Syntax
      op.firstSummit ()
    Params
      None.
    Returns
      undefined.
    Bug
      It does not return undefined, it returns true.
    Example
      op.firstSummit ()
        true
  op.countSubs
    Syntax
      op.countSubs ()
    Params
      None.
    Returns
      The number of children the bar cursor headline has.
    Example
      op.countSubs ()
        1
  op.hasSubs
    Syntax
      op.hasSubs ()
    Params
      None.
    Returns
      True if the bar cursor headline has children, false if it doesn't.
    Example
      op.hasSubs ()
        true
  op.getLineText
    Syntax
      op.getLineText ()
    Params
      None.
    Returns
      The text on the bar cursor headline.
    Example
      op.getLineText ()
        But what is the protocol if the user hits Cancel?
  op.setLineText
    Syntax
      op.setLineText (string)
    Params
      The string is the text that will replace the text of the bar cursor headline.
    Returns
      true.
    Example
      op.setLineText ("Hi mom!")
        true
  op.insert
    Syntax
      op.insert (string, direction)
    Params
      string is the text of the new headline to be created relative to the bar cursor headline.
      direction indicates which direction it will go.
        up, to create a previous sibling,
        down, to create a next sibling.
        left to create a sibling down from its parent.
        right to create a new first child of the bar cursor headline.
    Returns
      Garbage!
    Bug
      The returned value looks like some kind of jQuery object. Should be fixed!
    Example
      op.insert ("North Carolina", down)
  op.reorg
    Syntax
      op.reorg (direction, count)
    Params
      direction is one of the directions the outliner supports: up, down, left, right, flatup, flatdown, nodirection.
      count is the number of times the bar cursor outline will move in the indicated direction.
    What it does
      It reorganizes the outline. The operation is performed on the sub-outline the bar cursor points to and one of its adjacent siblings or parent.
      If direction is down, the bar cursor headline and all its descendants, switches places with its next sibling. If it's already the last sibling, it doesn't move.
      If the direction is up, the bar cursor outline switches places with its previous sibling.
      If the direction is right, it becomes the last child of its previous sibling. If it's already the first sibling, it doesn't move.
      If the direction is left, it becomes the next sibling of its parent. If it's already at the top level of the outline (it's a summit), it doesn't move.
    Returns
      true if it was able to move, false otherwise.
    Examples
      op.reorg (left, 1)
        true
      op.go (left, infinity)
        true
  op.promote
    Syntax
      op.promote ()
    Params
      None.
    What it does
      If the bar cursor headline has children, they are all moved to the left, to become siblings of the bar cursor headline.
    Returns
      undefined.
    Examples
      op.promote ()
        undefined
  op.demote
    Syntax
      op.demote ()
    Params
      None.
    What it does
      All siblings down from the bar cursor headline are moved to the right, to become children of the bar cursor headline.
      The bar cursor headline is expanded if necessary.
    Returns
      undefined.
    Examples
      op.demote ()
        undefined
  op.deleteSubs
    Syntax
      op.deleteSubs ()
    Params
      None.
    What it does
      Deletes all the children of the bar cursor headline.
    Returns
      undefined.
    Examples
      op.deleteSubs ()
        undefined
  op.getCursorOpml
    Syntax
      op.getCursorOpml ()
    Params
      None.
    Returns
      A string containing the OPML text of the bar cursor headline and all its subs.
    Examples
      op.getCursorOpml ()
        <?xml version="1.0"?> op.getCursorOpml ()
  op.insertOpml
    Syntax
      op.insertOpml (opmltext, direction)
    Params
      opmltext is a string containing the text representing an outline to be inserted relative to the bar cursor headline.
      direction indicates which direction the outline will go.
        up, to create a previous sibling,
        down, to create a next sibling.
        left to create a sibling down from its parent.
        right to create a new first child of the bar cursor headline.
    Returns
      true.
    Examples
      op.insertOpml ("", down)
        true
  op.bold
    Syntax
      op.bold ()
    Params
      None.
    What it does
      The selected text in the bar cursor headline is boldened.
    Notes
      The text is boldened by wrapping it in an HTML <b> element.
    Returns
      undefined.
    Example
      op.bold ()
        undefined
  op.italic
    Syntax
      op.italic ()
    Params
      None.
    What it does
      The selected text in the bar cursor headline is italicized.
    Notes
      The text is boldened by wrapping it in an HTML <i> element.
    Returns
      undefined.
    Example
      op.italic ()
        undefined
  op.strikethrough
    Syntax
      op.strikethrough ()
    Params
      None.
    What it does
      The selected text in the bar cursor headline is italicized.
    Notes
      The text is boldened by wrapping it in an HTML <i> element.
    Returns
      undefined.
    Example
      op.strikethrough ()
        undefined
  op.link
    Syntax
      op.link (string)
    Params
      string is a web address, a url.
    Returns
      undefined.
    Example
      op.link ("http://scripting.com/")
        undefined
  op.isComment
    Syntax
      op.isComment ()
    Params
      None.
    Returns
      true if the bar cursor headline is a comment, false otherwise.
    Example
      op.isComment ()
        true
  op.makeComment
    Syntax
      op.makeComment ()
    Params
      None.
    What it does
      It makes the bar cursor headline a comment.
    Returns
      true if the bar cursor headline is a comment, false otherwise.
    Example
      op.makeComment ()
        true
  op.toggleComment
    Syntax
      op.toggleComment ()
    Params
      None.
    What it does
      If the bar cursor headline is not a comment it makes it one, and if it is a comment, it makes it not a comment.
    Returns
      undefined.
    Example
      op.toggleComment ()
        undefined
  op.setRenderMode
    Syntax
      op.setRenderMode (boolean)
    Params
      boolean determines whether we go into or out of render mode.
    What it does
      In render mode the outline is displayed with HTML rendered. The markup is not visible. So for example, bold text appears bold, not within a <b> tag.
    Returns
      true if the bar cursor headline is a comment, false otherwise.
    Examples
      op.setRenderMode (false)
        undefined
      op.setRenderMode (true)
        undefined
  op.getRenderMode
    Syntax
      op.getRenderMode ()
    Params
      None.
    Returns
      true if the outline is in render mode, false otherwise.
    Example
      op.getRenderMode ()
        true
      op.setRenderMode (true)
        undefined
  op.toggleRenderMode
    Syntax
      op.toggleRenderMode ()
    Params
      None.
    What it does
      If you're in render mode, after this verb runs your outline will no longer be in render mode, and if you're not in render mode, after running this verb your outline will no longer be in render mode.
    Returns
      undefined.
    Example
      op.toggleRenderMode ()
        undefined
  op.getCursor
    Syntax
      op.getCursor ()
    Params
      None.
    Bug
      There does not appear to be an op.setCursor to balance this verb.
    Returns
      An object representing the bar cursor.
    Example
      op.getCursor ()
        { "attributes": { "_cssTextClassName": "cssTextClass" } }
  op.runSelection
    Syntax
      op.runSelection ()
    Params
      None.
    Returns
      undefined.
    Bug
      It uses the old form of running the selection.
    Example
      op.runSelection ()
  not documented yet
    op.expandTo -- I want to document the simpler ones first.