Unclassified NewsBoard Code Reference

UnbEncloseText function [JavaScript]

Enclose the currently selected text with an opening and closing text

function UnbEncloseText (t_open, t_close, cursorpos);

Parameters:

t_open
(string) Opening text
t_close
(string) Closing text
cursorpos
(int) 0: begin | 1: middle | 2: end
(only relevant if no text is selected)

Remarks:

If there is no selection, the text is inserted or appended.
If the current selection already includes the text, it is removed instead.

Implementation file: unb_lib/designs/native/js/posteditor.js.php, line 136

© 2006 Yves Goergen. Unclassified NewsBoard Homepage. Reference based on UNB unb.devel.20060128, dated 2006-01-28.