javascript Programming Glossary: rangy.getselection
Tag-like autocompletion and caret/cursor movement in contenteditable elements http://stackoverflow.com/questions/2798142/tag-like-autocompletion-and-caret-cursor-movement-in-contenteditable-elements range.setStartAfter aElement range.collapse true var sel rangy.getSelection sel.removeAllRanges sel.addRange range share improve this..
Cross Browser Selection Range Library? http://stackoverflow.com/questions/3454152/cross-browser-selection-range-library surroundSelectedText templateElement var range sel rangy.getSelection var ranges sel.getAllRanges var textNodes textNode el i len..
Set caret position right after the inserted element in a contentEditable div http://stackoverflow.com/questions/4834793/set-caret-position-right-after-the-inserted-element-in-a-contenteditable-div there would be function insertNodeAtCaret node var sel rangy.getSelection if sel.rangeCount var range sel.getRangeAt 0 range.collapse..
replace innerHTML in contenteditable div http://stackoverflow.com/questions/5595956/replace-innerhtml-in-contenteditable-div charIndex 0 start 0 end 0 foundStart false stop var sel rangy.getSelection range function traverseTextNodes node range if node.nodeType.. i try traverseTextNodes containerEl catch ex if ex stop rangy.getSelection .setSingleRange range else throw ex function formatText var..
Insert link in contenteditable element http://stackoverflow.com/questions/5605401/insert-link-in-contenteditable-element all is tricky. You could use my own Rangy library var sel rangy.getSelection if sel.rangeCount var links sel.getRangeAt 0 .getNodes 1 function..
how to get selection inside a div using jquery/javascript http://stackoverflow.com/questions/5801347/how-to-get-selection-inside-a-div-using-jquery-javascript function getSelectedTextWithin el var selectedText var sel rangy.getSelection rangeCount sel.rangeCount var range rangy.createRange range.selectNodeContents..
|