PHP2Go Javascript Framework

Class Selection

Object
   |
   +--Selection

class Selection

Defined in util/selection.js


Field Summary
 Object doc
          HTML document
 Object win
          Document's parent window
 
Constructor Summary
Selection (doc, win)
            The Selection class deals with selection and selection ranges inside an HTML document
 
Method Summary
 void clear()
           Clean up the selection
 void collapse(<Boolean> start)
           Collapse the document selection
 Object getBookmark()
           Return a bookmark to the current selection range
 Object getParentByTagNames(<String> tags)
           Traverses the document tree up searching for an element which tag is one of the listed tag names.
 Object getRange()
           Return the first range of the current selection, or create a new one
 Object getSelectedElement()
           Return the current selected element
 String getSelectedHTML()
           Retrieve the HTML contents of the current selection
 Object getSelection()
           Return the native selection object associated with the document
 String getType()
           Get the type of the current selection.
 void restore()
           Restore the selection from the cache
 void save()
           Save the selection in an internal cache
 void selectElement(<Object> elm, collapse, start)
           Set a new selection in the document, so that the passed element is between the start and end of the created selection range

Field Detail

doc

Object doc

win

Object win

Constructor Detail

Selection

Selection(doc, win)

Method Detail

clear

void clear()

collapse

void collapse(<Boolean> start)

getBookmark

Object getBookmark()

getParentByTagNames

Object getParentByTagNames(<String> tags)

getRange

Object getRange()

getSelectedElement

Object getSelectedElement()

getSelectedHTML

String getSelectedHTML()

getSelection

Object getSelection()

getType

String getType()

restore

void restore()

save

void save()

selectElement

void selectElement(<Object> elm, collapse, start)

PHP2Go Javascript Framework

Copyright © 2002-2006 by Marcos Pont
Documentation generated by JSDoc on Sun Oct 7 19:52:10 2007