Skip to content

{ Category Archives } bililiteRange

bililiteRange undo

This is a plugin for bililiteRange that implements a simple undo/redo stack. It listens for input events (so to use it in IE

Simple syntax-highlighting editor with Prism

Prism is a great Javascript syntax highlighter, and it's fast enough to be used on the fly for active editing; Lea Verou (the author) does this with Dabblet. Combined with bililiteRange to handle some of the subtleties of dealing with contenteditable elements, a syntax-highlighting editor is relatively easy. Simplest usage: bililiteRange.fancyText(element, Prism.highlightelement);. See the demo. […]

wrap method for bililiteRange

I wanted to be able to wrap arbitrary text with HTML elements, so I added a wrap method to my bililiteRange routines. Now I can do something like bililiteRange(el).find(/foo/).wrap(document.createElement('strong')) and I have instant highlighting! It obviously can only work if the range is defined on an actual HTML element, not on the text of a […]

bililiteRange Plugins

Edited 2014-02-27 to add the indentation code. I created a collection of useful plugins for my bililiteRange, for more sophisticated manipulations. Now you can search the element with a regular expression, and you can keep the range "live", adjusting it when the text is edited. Download the code. See the demo. (The dynamic highlighting is […]

Improved bililiteRange

I've been working on a project that uses bililiteRange a lot, so I added two improvements: plugins and events. bililiteRange.fn.myplugin = function() {}; or bililiteRange.extend({ myplugin1: function() {}, myplugin2: function(){} }); creates new functions for a bililiteRange (just like with jQuery). Also, the text method now triggers an input event on the element. Only works […]

Cross-Browser Text Ranges and Selections

Updated to version 2.3 on 2014-02-26 for data routines. I was trying to update my sendkeys plugin to use contentEditable, and realized that it was getting harder and harder to do without some selection/text replacement library. Each browser is different and even different elements are treated differently. There are a few libraries out there, but […]