|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Xinha
Defined in XinhaCore.js
Version: $Rev: 819 $ $LastChangedDate: 2007-04-20 01:20:22 +0200 (Fr, 20 Apr 2007) $
Nested Class Summary | |
<static class> |
Xinha.Config |
Field Summary | |
integer |
__htmlarea_id_num
running number that identifies the current editor |
<private> Boolean |
_customUndo
use our own undo implementation (true) or the browser's (false) |
document |
_doc
The document object of the iframe. Use this property to perform DOM operations on the edited document |
<private> string "wysiwyg"|"text" |
_editMode
the current editing mode |
Object framework parts |
_framework
Holds the parts (table cells) of the UI (toolbar, panels, statusbar) |
<private> DomNode |
_htmlArea
Them whole thing (table) |
window |
_iframe
This is the actual editable area. Technically it's an iframe that's made editable using window.designMode = 'on', respectively document.body.contentEditable = true (IE). Use this property to get a grip on the iframe's window features |
<private> Object w,h |
_initial_ta_size
Before we modify anything, get the initial textarea size |
<private> document |
_mdoc
the document object of the page Xinha is embedded in |
<private> Object |
_notifyListeners
holds the events for use with the notifyOn/notifyOf system |
<private> Array |
_panels
holds the panels |
DomNode statusbar div |
_statusBar
The statusbar container |
<private> Array tag names |
_statusBarItems
Holds the items of the DOM path that is shown in the statusbar in wysiwyg mode |
<private> DomNode |
_statusBarTextMode
The message that is shown in the statusbar in text mode |
<private> DomNode |
_statusBarTree
The DOM path that is shown in the statusbar in wysiwyg mode |
DomNode textarea |
_textArea
This property references the original textarea, which is at the same time the editor in text mode |
<private> timeout |
_timerToolbar
periodically updates the toolbar |
<private> timeout |
_timerUndo
periodically takes a snapshot of the current editor content |
<private> DomNode |
_toolBar
The toolbar |
<private> Object |
_toolbarObjects
Holds the botton objects |
<private> integer |
_undoPos
the current position in the undo queue |
<private> Array |
_undoQueue
holds the undo snapshots |
Xinha.Config |
config
The configuration used in the editor |
<private> string |
doctype
doctype of the edited document (fullpage mode) |
<private> Object |
panels
|
<private> Object |
plugins
this object holds the plugins used in the editor |
<static> Object |
_addClasses
Alias of Xinha.addClasses() |
<private> <static> {String} |
_blockTags
List of tag names that are defined as block level elements in HTML |
<static> Object |
_closingTags
|
<private> <static> {Xinha} |
_currentlyActiveEditor
Stores a reference to the currently active editor |
<static> Array |
_eventFlushers
Holds the events to be flushed |
<private> <static> {Object} |
_object
Variable used to pass the object to the popup editor window. |
<private> <static> {String} |
_paraContainerTags
List of tag names that are allowed to contain a paragraph |
<private> <static> {Object} |
_pluginLoadStatus
Stores a status for each loading plugin that may be one of "loading","ready", or "failed" |
<static> Object |
_removeClasses
Alias of Xinha.removeClasses() |
<private> <static> {Boolean} |
_someEditorHasBeenActivated
We need to know that at least one editor on the page has been activated this is because we will not focus any editor until an editor has been activated |
<static> Object |
addClass
Alias of Xinha._addClass() |
<private> <static> Object |
agt
Cache the user agent for the following checks |
<static> string |
ie_version
Version Number, if browser is Microsoft Internet Explorer |
<private> <static> string |
is_designMode
Editing is enabled by document.designMode (Gecko, Opera), as opposed to contenteditable (IE) |
<static> string |
is_gecko
Browserengine is Gecko (Mozilla) |
<static> string |
is_ie
Browser is Microsoft Internet Explorer |
<static> string |
is_khtml
Browserengine is KHTML (Konqueror, Safari) |
<static> string |
is_mac
OS is MacOS |
<static> string |
is_mac_ie
Browser is Microsoft Internet Explorer Mac |
<static> string |
is_opera
Browser is Opera |
<static> string |
is_safari
Browser is Safari |
<static> string |
is_win_ie
Browser is Microsoft Internet Explorer Windows |
<private> <static> string |
isRunLocally
File is opened locally opened ("file://" protocol) |
<private> <static> Boolean |
isSupportedBrowser
Cache result of checking for browser support |
<static> string |
opera_version
Version Number, if browser is Opera |
<static> RegExp |
RE_body
Finds body section in HTML |
<static> RegExp |
RE_doctype
Exracts DOCTYPE string from HTML |
<static> RegExp |
RE_email
Identifies email addresses |
<static> RegExp |
RE_head
Finds head section in HTML |
<private> <static> RegExp |
RE_Specials
Special characters that need to be escaped when dynamically creating a RegExp from an arbtrary string |
<static> RegExp |
RE_tagName
Identifies HTML tag names |
<static> RegExp |
RE_url
Identifies URLs |
<static> Object |
removeClass
Alias of Xinha.Xinha._removeClass() |
<private> <static> Object |
toFree
List of objects that have to be trated on page unload in order to work around the broken Garbage Collector in IE |
<private> <static> Object |
uniq_count
Index for Xinha.uniq function |
<static> Object |
version
|
Constructor Summary | |
Xinha(<String|DomNode> textarea, <Xinha.Config> config)
Creates a new Xinha object |
Method Summary | |
DomNode|null
|
_activeElement(sel)
Alias of activeElement() |
<private> void
|
_addToolbar()
FIXME: How can this be used?? |
void
|
_clearFonts()
Removes <font> tags; always cleans the whole editor content |
<private> void
|
_colorSelector(<String> cmdID)
Open a popup to select the hilitecolor or forecolor |
<private> DomNode|null
|
_comboSelected(<DomNode> el, <String> txt)
onChange handler for dropdowns in toolbar |
void
|
_createImplicitBlock(type)
What's this? |
Range
|
_createRange(<Selection> sel)
Alias of createRange() |
<private> DomNode
|
_createStatusBar()
creates the status bar |
<private> DomNode
|
_createToolbar()
Creates the toolbar and appends it to the _htmlarea |
<private> DomNode
|
_createToolbar1(editor, toolbar, tb_objects)
separate from previous createToolBar to allow dynamic change of toolbar |
Object
|
_editorEvent(<Event> ev)
A generic event handler for things that happen in the IFRAME's document. It provides two hooks for the "firePluginEvent" system: "onKeyPress" "onMouseDown" |
DomNode|null
|
_getAncestorBlock(<Selection> sel)
Traverses the DOM upwards and returns the first element that is a block level element |
DomNode|null
|
_getFirstAncestor(<Selection> sel, <Array> types)
Traverses the DOM upwards and returns the first element that is of one of the specified types |
Selection
|
_getSelection()
Alias of getSelection() |
void
|
_popupDialog(<String> url, <Function> action, <Mixed> init)
Modal popup dialogs |
Boolean
|
_selectionEmpty(<Selection> sel)
Alias of selectionEmpty() |
<private> void
|
_setConfig(config)
FIXME : function never used, can probably be removed from source |
<private> void
|
_shortCuts(<Event> ev)
Handles ctrl + key shortcuts |
void
|
_splitBlock()
|
Boolean
|
_toggleBorders()
Use some CSS trickery to toggle borders on tables |
<private> void
|
_undoTakeSnapshot()
Takes a snapshot of the current text (for undo) |
void
|
_wordClean()
Cleans dirty HTML from MS word; always cleans the whole editor content |
<private> Boolean
|
activateEditor()
Enables one editor for editing, e.g. |
DomNode|null
|
activeElement(sel)
Returns the selected element, if any. |
DomNode
|
addPanel(<String> side)
Creates a panel in the panel container on the specified side |
DomNode
|
convertNode(<DomNode> el, <String> newTagName)
Changes the type of a given node |
Range
|
createRange(<Selection> sel)
Create a Range object from the given selection. |
<private> void
|
deactivateEditor()
Disables the editor |
void
|
debugTree()
Utility function: Outputs the structure of the edited document |
void
|
disableToolbar(<Array> except)
Disables (greys out) the buttons of the toolbar |
<private> Boolean
|
editorIsActivated()
Checks if editor is active EDITOR ACTIVATION NOTES: when a page has multiple Xinha editors, ONLY ONE should be activated at any time (this is mostly to work around a bug in Mozilla, but also makes some sense). |
void
|
enableToolbar()
Enables the toolbar again when disabled by disableToolbar() |
Boolean
|
execCommand(<String> cmdID, <Boolean> UI, <Mixed> param)
This is a wrapper for the browser's execCommand function that handles things like formatting, inserting elements, etc. It intercepts some commands and replaces them with our own implementation. It provides a hook for the "firePluginEvent" system ("onExecCommand"). For reference see: Mozilla implementation MS implementation |
Boolean
|
firePluginEvent(<String> methodName)
Call a method of all plugins which define the method using the supplied arguments. |
<private> String
|
fixRelativeLinks(<String> html)
Transforms the paths in src & href attributes |
document
|
focusEditor()
Focuses the iframe window. |
void
|
forceRedraw()
Sometimes the display has to be refreshed to make DOM changes visible (?) (Gecko bug?) |
Boolean
|
generate()
Creates the Xinha object and replaces the textarea with it. |
Array
|
getAllAncestors()
Returns an array with all the ancestor nodes of the selection or current cursor position. |
String
|
getEditorContent()
Get the edited HTML |
<private> String
|
getHTML()
Get the raw edited HTML, should not be used without Xinha.prototype.outwardHtml() |
<private> String
|
getInnerHTML()
retrieve the HTML (fastest version, but uses innerHTML) |
String
|
getKey(<Event> keyEvent)
Return the character (as a string) of a keyEvent - ie, press the 'a' key and this method will return 'a', press SHIFT-a and it will return 'A'. |
DomNode
|
getParentElement(<Selection> sel)
Get the parent element of the supplied or current selection. |
String
|
getSelectedHTML()
Get the HTML of the current selection. |
Selection
|
getSelection()
Get a Selection object of the current selection. |
Boolean
|
hasSelectedText()
Return true if we have some selection |
void
|
hidePanel(<DomNode> panel)
Hides a panel |
void
|
hidePanels(<Array> sides)
Hides the panel(s) on one or more sides |
String
|
imgURL(<String> file, <String> plugin)
Creates a path in the form _editor_url + "plugins/" + plugin + "/img/" + file |
<private> Object
|
initIframe()
Creates the iframe (editable area) |
<private> void
|
initSize()
Size the editor according to the INITIAL sizing information. |
void
|
insertHTML(<String> html)
Insert HTML at the current position, deleting the selection if any. |
void
|
insertNodeAtSelection(<DomNode> toBeInserted)
Insert a node at the current selection point. |
<private> String
|
inwardHtml(<String> html)
Performs various transformations of the HTML to be edited Plugins can provide their own, additional transformations by defining a plugin.prototype.inwardHtml() implematation, which is called by this function |
<private> String
|
inwardSpecialReplacements(<String> html)
Apply the replacements defined in Xinha.Config.specialReplacements |
Boolean
|
isKeyEvent(<Event> event)
Determine if the given event object is a keydown/press event. |
Boolean
|
isShortCut(<Event> keyEvent)
Determines if the given key event object represents a combination of CTRL- |
void
|
notifyOf(ev, args)
|
void
|
notifyOn(ev, fn)
|
<private> String
|
outwardHtml(<String> html)
Performs various transformations of the HTML used internally, complement to Xinha.prototype.inwardHtml() Plugins can provide their own, additional transformations by defining a plugin.prototype.outwardHtml() implematation, which is called by this function |
<private> String
|
outwardSpecialReplacements(<String> html)
Apply the replacements defined in Xinha.Config.specialReplacements |
String
|
popupURL(<String> file)
Creates a path |
<private> void
|
redo()
Custom implementation of redo functionality |
void
|
registerPanel(<string> side, object)
FIXME: Never used, what is this for? |
Object
|
registerPlugin()
Create the specified plugin and register it with this Xinha return the plugin created to allow refresh when necessary. This is only useful if Xinha is generated without using Xinha.makeEditors() |
<private> Object
|
registerPlugin2(plugin, args)
This is the variant of the function above where the plugin arguments are already packed in an array. |
<private> void
|
registerPlugins(<Array> plugin_names)
Registers the loaded plugins with the editor |
void
|
removeLoadingMessage()
|
void
|
removePanel(<DomNode> panel)
Removes a panel |
void
|
restoreSelection(<Range> savedSelection)
Restores a selection previously stored |
Range
|
saveSelection()
Returns a range object to be stored and later restored with Xinha.prototype.restoreSelection() |
Object
|
scrollPos(<Window> scope)
Detect the current scroll position |
void
|
scrollToElement(<DomNode> e)
Scrolls the editor iframe to a given element or to the cursor |
Boolean
|
selectionEmpty(<Selection> sel)
Determines if the given selection is empty (collapsed). |
void
|
selectNodeContents(<DomNode> node,<Integer> pos)
Selects the contents of the given node. |
<private> void
|
setDoctype(<String> doctype)
sets the given doctype (useful only when config.fullPage is true) |
void
|
setEditorContent(<String> html)
Completely change the HTML inside the editor |
<private> void
|
setEditorEvents()
Initialize some event handlers |
<private> Object
|
setFullHTML(<String> html)
Sets the HTML in fullpage mode. |
<private> void
|
setHTML(<String> html)
Completely change the HTML inside |
void
|
setLoadingMessage(string)
|
Object
|
setMode(<String> mode)
Switches editor mode between wysiwyg and text (HTML) |
void
|
showPanel(<DomNode> panel)
Shows a panel |
void
|
showPanels(<Array> sides)
Shows the panel(s) on one or more sides |
void
|
sizeEditor(<string> width, <string> height, <Boolean> includingBars, <Boolean> includingPanels)
Size the editor to a specific size, or just refresh the size (when window resizes for example) |
String
|
stripBaseURL(<String> string)
Strips host-part of URL which is added by browsers to links relative to server root |
<private> void
|
surroundHTML(startTag, endTag)
Call this function to surround the existing HTML code in the selection with your tags. |
<private> void
|
undo()
Custom implementation of undo functionality |
void
|
updateToolbar(<Boolean> noStatus)
Updates enabled/disable/active state of the toolbar elements, the statusbar and other things This function is called on every key stroke as well as by a timer on a regular basis. Plugins have the opportunity to implement a prototype.onUpdateToolbar() method, which will also be called by this function. |
void
|
whenDocReady(<Function> f)
Delay a function until the document is ready for operations. |
<static> void
|
_addClass(<DomNode> el, <String> className)
Adds one CSS class to a given element (that is, it expands its className property by the given string, separated by a space) |
<static> void
|
_addEvent(<DomNode> el, <String> evname, <function> func)
adds an event listener for the specified element and event type |
<static> void
|
_addEvents(<DomNode> el, <Array> evs, <function> func)
add several events at once to one element |
<static> String
|
_colorToRgb(<String|Integer> v)
Returns hexadecimal color representation from a number or a rgb-style color. |
<static> <private> DomNode
|
_createToolbarBreakingElement()
Create a break element to add in the toolbar |
<static> void
|
_getback(<String> url, <Function> handler)
Use XMLHTTPRequest to receive some data from the server and do something with the it (asyncronously!) |
<static> Object
|
_geturlcontent(<String> url)
Use XMLHTTPRequest to receive some data from the server syncronously |
<static> Boolean
|
_hasClass(<DomNode> el, <String> className)
Checks if one element has set the given className |
<static> Object
|
_lc(<String> string, <String> context, <Object> replace)
Return a localised string. |
<static> Object
|
_loadback(<String> url, <Object> callback, <Object> scope, <Object> bonus)
Load a javascript file by inserting it in the HEAD tag and eventually call a function when loaded |
<static> <private> Object
|
_loadlang(<String> context,url)
Load a language file. |
<static> String
|
_makeColor(v)
Creates a rgb-style rgb(r,g,b) color from a (24bit) number |
<static> void
|
_postback(<String> url, <Object> data, <Function> handler)
Use XMLHTTPRequest to post some data back to the server and do something with the response (asyncronously!), this is used by such things as the tidy functions |
<static> <private> void
|
_prepareForDom0Events(el, ev)
Prepares an element to receive more than one DOM-0 event handler when handlers are added via addDom0Event and prependDom0Event. |
<static> void
|
_removeClass(<DomNode> el, <String> className)
Removes one CSS class (that is one of possible more parts separated by spaces) from a given element |
<static> void
|
_removeEvent(<DomNode> el, <String> evname, <function> func)
removes an event listener previously added |
<static> void
|
_removeEvents(<DomNode> el, <Array> evs, <function> func)
remove several events at once to from element |
<static> Object
|
_resolveRelativeUrl( base, url )
|
<static> void
|
_stopEvent(<event> ev)
stops bubbling of the event, if no further listeners should be triggered |
<static> void
|
addClasses(<DomNode> el, <String> classes)
Adds CSS classes to a given element (that is, it expands its className property by the given string, separated by a space, thereby checking that no class is doubly added) |
<static> <private> String
|
addCoreCSS(<String> html)
Adds styles for internal use to the edited document |
<static> void
|
addDom0Event(<DomNode> el, <String> ev, <function> fn)
Adds a standard "DOM-0" event listener to an element. |
<static> Boolean
|
arrayContainsArray(<Array> a1, <Array> a2)
Returns true if all elements of a2 are also contained in a1 (at least I think this is what it does) |
<static> Array
|
arrayFilter(<Array> a1, <Function> filterfn)
Walks through an array and applies a filter function to each item |
<static> String
|
base64_decode(<String> input)
Utility function to base64_decode some arbitrary data, uses the builtin atob() if it exists (Moz) |
<static> String
|
base64_encode(<String> input)
Utility function to base64_encode some arbitrary data, uses the builtin btoa() if it exists (Moz) |
<static> <private> Boolean
|
checkSupportedBrowser()
Check if Xinha can run in the used browser, otherwise the textarea will be remain unchanged |
<static> <private> Object
|
cloneObject(<Object> obj)
function that returns a clone of the given object |
<static> <private> void
|
collectGarbageForIE()
IE's Garbage Collector is broken very badly. |
<static> Array
|
collectionToArray(<Collection> collection)
Converts a Collection object to an array |
<static> Object
|
createLoadingMessage(textarea,text)
|
<static> void
|
createLoadingMessages(xinha_editors)
|
<static> Object
|
escapeStringForRegExp(<string> string)
When dynamically creating a RegExp from an arbtrary string, some charactes that have special meanings in regular expressions have to be escaped. |
<static> Integer
|
findPosX(obj)
Find left pixel position of an element in the DOM. |
<static> Integer
|
findPosY(obj)
Find top pixel position of an element in the DOM. |
<static> <private> void
|
flushEvents()
Event Flushing To try and work around memory leaks in the rather broken garbage collector in IE, Xinha.flushEvents can be called onunload, it will remove any event listeners (that were added through _addEvent(s)) and clear any DOM-0 events. |
<static> <private> void
|
free(obj, prop)
Release memory properties from object |
<static> <private> void
|
freeLater(obj,prop)
Adds objects to Xinha.toFree |
<static> DomNode
|
getElementById(<String> tag, <String> id)
FIX: Internet Explorer returns an item having the _name_ equal to the given id, even if it's not having any id. |
<static> Object
|
getElementTopLeft(<DomNode> element)
Calculate the top and left pixel position of an element in the DOM. |
<static> Object
|
getInnerText(<DomNode> el)
Extracts the textual content of a given node |
<static> String
|
getOuterHTML(<DomNode> element)
Return the HTML string of the given Element, including the Element. |
<static> <private> String
|
getPluginDir(<String> pluginName)
Dynamically returns the directory from which the plugins are loaded This could be overridden to change the dir |
<static> XMLHTTPRequest
|
getXMLHTTPRequestObject()
Get a new XMLHTTPRequest Object ready to be used. |
<static> Boolean
|
hasDisplayedChildren(<DomNode> el)
Walks through the children of a given element and checks if any of the are visible (= not display:none) |
<static> Boolean
|
hasParentNode(<DomNode> el)
Checks if some element has a parent node |
<static> String
|
htmlEncode(<String> str)
Performs HTML encoding of some given string (converts HTML special characters to entities) |
<static> void
|
init()
|
<static> Boolean
|
isBlockElement(<DomNode> el)
Checks if one element is in the list of elements that are defined as block level elements in HTML |
<static> Boolean
|
isParaContainer(<DomNode> el)
Checks if one element is in the list of elements that are allowed to contain a paragraph in HTML |
<static> Boolean
|
loadPlugin(<String> pluginName, <Function> callback, <String> plugin_file)
Static function that loads the given plugin |
<static> Boolean
|
loadPlugins(<Array> plugins, <Function> callbackIfNotReady)
Static function that loads the plugins (see xinha_plugins in NewbieGuide) |
<static> void
|
loadStyle(<String> style, <String> plugin, <String> id)
Adds a stylesheet to the document |
<static> <private> DomNode
|
makeBtnImg(imgDef, doc)
creates a button (i.e. |
<static> Object
|
makeEditors(<Array> editor_names, <Xinha.Config> default_config, <Array> plugin_names)
Xinha's main loading function (see NewbieGuide) |
<static> Boolean
|
needsClosingTag(<DomNode> el)
Checks if one element is in the list of elements for which the end tag is not optional or forbidden in HTML |
<static> void
|
notImplemented(methodName)
|
<static> Array
|
objectProperties(<Object> obj)
Returns an array containig all properties that are set in an object |
<static> void
|
onload()
|
<static> Object
|
pageSize(<Window> scope)
Detect the size of the whole document |
<static> void
|
prependDom0Event(el, ev, fn)
See addDom0Event, the difference is that handlers registered using prependDom0Event will be triggered before existing DOM-0 events of the same name on the same element. |
<static> <private> void
|
refreshPlugin(<PluginInstance> plugin)
Refresh plugin by calling onGenerate or onGenerateOnce method. |
<static> Object
|
removeClasses(<DomNode> el, classes)
Removes CSS classes (that is one or more of possibly several parts separated by spaces) from a given element |
<static> DomNode
|
removeFromParent(<DomNode> el)
Removes a node from the DOM |
<static> void
|
removeLoadingMessages(xinha_editors)
|
<static> Object
|
replace(<string> id, config)
Helper function: replaces the TEXTAREA with the given ID with Xinha. |
<static> void
|
replaceAll(config)
Helper function: replace all TEXTAREA-s in the document with Xinha-s. |
<static> void
|
setLoadingMessage(string)
|
<static> void
|
startEditors(<Object> editors)
Another main loading function (see NewbieGuide) |
<static> <private> String
|
stripCoreCSS(<String> html)
Remove internal styles |
<static> String
|
uniq(<String> prefix)
Returns a string that is unique on the page |
<static> Object
|
viewportSize(<Window> scope)
Detect the size of visible area |
Field Detail |
integer __htmlarea_id_num
<private> Boolean _customUndo
document _doc
<private> string "wysiwyg"|"text" _editMode
Object framework parts _framework
<private> DomNode _htmlArea
window _iframe
<private> Object w,h _initial_ta_size
<private> document _mdoc
<private> Object _notifyListeners
<private> Array _panels
DomNode statusbar div _statusBar
<private> Array tag names _statusBarItems
<private> DomNode _statusBarTextMode
<private> DomNode _statusBarTree
DomNode textarea _textArea
<private> timeout _timerToolbar
<private> timeout _timerUndo
<private> DomNode _toolBar
<private> Object _toolbarObjects
<private> integer _undoPos
<private> Array _undoQueue
Xinha.Config config
<private> string doctype
<private> Object panels
<private> Object plugins
<static> Object _addClasses
<private> <static> {String} _blockTags
<static> Object _closingTags
<private> <static> {Xinha} _currentlyActiveEditor
<static> Array _eventFlushers
<private> <static> {Object} _object
<private> <static> {String} _paraContainerTags
<private> <static> {Object} _pluginLoadStatus
<static> Object _removeClasses
<private> <static> {Boolean} _someEditorHasBeenActivated
<static> Object addClass
<private> <static> Object agt
<static> string ie_version
<private> <static> string is_designMode
<static> string is_gecko
<static> string is_ie
<static> string is_khtml
<static> string is_mac
<static> string is_mac_ie
<static> string is_opera
<static> string is_safari
<static> string is_win_ie
<private> <static> string isRunLocally
<private> <static> Boolean isSupportedBrowser
<static> string opera_version
<static> RegExp RE_body
<static> RegExp RE_doctype
<static> RegExp RE_email
<static> RegExp RE_head
<private> <static> RegExp RE_Specials
<static> RegExp RE_tagName
<static> RegExp RE_url
<static> Object removeClass
<private> <static> Object toFree
<private> <static> Object uniq_count
<static> Object version
Constructor Detail |
Xinha(<String|DomNode> textarea, <Xinha.Config> config)
textarea
- the textarea to replace; can be either only the id or the DOM object as returned by document.getElementById()
config
- optional if no Xinha.Config object is passed, the default config is used
Method Detail |
DomNode|null _activeElement(sel)
<private> void _addToolbar()
void _clearFonts()
<private> void _colorSelector(<String> cmdID)
cmdID
- The commande ID (hilitecolor or forecolor)
<private> DomNode|null _comboSelected(<DomNode> el, <String> txt)
el
- Reference to the SELECT object
txt
- The name of the select field, as in config.toolbar
void _createImplicitBlock(type)
Range _createRange(<Selection> sel)
sel
- Selection object
<private> DomNode _createStatusBar()
<private> DomNode _createToolbar()
<private> DomNode _createToolbar1(editor, toolbar, tb_objects)
Object _editorEvent(<Event> ev)
ev
-
DomNode|null _getAncestorBlock(<Selection> sel)
sel
- Selection object as returned by getSelection
DomNode|null _getFirstAncestor(<Selection> sel, <Array> types)
sel
- Selection object as returned by getSelection
types
- Array of HTML tag names (lower case)
Selection _getSelection()
void _popupDialog(<String> url, <Function> action, <Mixed> init)
url
- URL to the popup dialog
action
- A function that receives one value; this function will get called after the dialog is closed, with the return value of the dialog.
init
- A variable that is passed to the popup window to pass arbitrary data
Boolean _selectionEmpty(<Selection> sel)
sel
- Selection object as returned by getSelection
<private> void _setConfig(config)
<private> void _shortCuts(<Event> ev)
ev
-
void _splitBlock()
Boolean _toggleBorders()
<private> void _undoTakeSnapshot()
void _wordClean()
<private> Boolean activateEditor()
DomNode|null activeElement(sel)
DomNode addPanel(<String> side)
side
- the panel container to which the new panel will be addedDomNode convertNode(<DomNode> el, <String> newTagName)
el
- The element to convert
newTagName
- The type the element will be converted to
Range createRange(<Selection> sel)
sel
- Selection object
<private> void deactivateEditor()
void debugTree()
void disableToolbar(<Array> except)
except
- this array contains ids of toolbar objects that will not be disabled
<private> Boolean editorIsActivated()
void enableToolbar()
Boolean execCommand(<String> cmdID, <Boolean> UI, <Mixed> param)
cmdID
- command to be executed as defined in the browsers implemantations or Xinha custom
UI
- for compatibility with the execCommand syntax; false in most (all) cases
param
- Some commands require parameters
Boolean firePluginEvent(<String> methodName)
editor.firePluginEvent('onExecCommand', 'paste')
PluginName.prototype.onExecCommand = function (cmdID, UI, param) {do something...}
methodName | Parameters |
---|---|
onExecCommand | cmdID, UI, param |
onKeyPress | ev |
onMouseDown | ev |
methodName
-
arguments
- to pass to the method, optional [2..n]
<private> String fixRelativeLinks(<String> html)
html
-
document focusEditor()
void forceRedraw()
Boolean generate()
Array getAllAncestors()
String getEditorContent()
<private> String getHTML()
<private> String getInnerHTML()
String getKey(<Event> keyEvent)
keyEvent
-
DomNode getParentElement(<Selection> sel)
sel
- optional selection as returned by getSelection
String getSelectedHTML()
Selection getSelection()
Boolean hasSelectedText()
void hidePanel(<DomNode> panel)
panel
- object as returned by Xinha.prototype.addPanel()
void hidePanels(<Array> sides)
sides
- the sides on which the panels shall be hidden
String imgURL(<String> file, <String> plugin)
file
- Name of the image
plugin
- optional If omitted, simply _editor_url + file is returned
<private> Object initIframe()
<private> void initSize()
void insertHTML(<String> html)
html
-
void insertNodeAtSelection(<DomNode> toBeInserted)
toBeInserted
-
<private> String inwardHtml(<String> html)
html
-
<private> String inwardSpecialReplacements(<String> html)
html
-
Boolean isKeyEvent(<Event> event)
event
-
Boolean isShortCut(<Event> keyEvent)
keyEvent
-
void notifyOf(ev, args)
void notifyOn(ev, fn)
<private> String outwardHtml(<String> html)
html
-
<private> String outwardSpecialReplacements(<String> html)
html
-
String popupURL(<String> file)
file
- Name of the popup
<private> void redo()
void registerPanel(<string> side, object)
side
-
Object
- }
Object registerPlugin()
<private> Object registerPlugin2(plugin, args)
<private> void registerPlugins(<Array> plugin_names)
plugin_names
-
void removeLoadingMessage()
void removePanel(<DomNode> panel)
panel
- object as returned by Xinha.prototype.addPanel()
void restoreSelection(<Range> savedSelection)
savedSelection
- Range object as returned by Xinha.prototype.restoreSelection()
Range saveSelection()
Object scrollPos(<Window> scope)
scope
- optional When calling from a popup window, pass its window object to get the values of the popup
void scrollToElement(<DomNode> e)
e
- optional The element to scroll to; if ommitted, element the element the cursor is in
Boolean selectionEmpty(<Selection> sel)
sel
- Selection object as returned by getSelection
void selectNodeContents(<DomNode> node,<Integer> pos)
node
-
pos
- Set to a numeric position inside the node to collapse the cursor here if possible.
<private> void setDoctype(<String> doctype)
doctype
-
void setEditorContent(<String> html)
html
- new content
<private> void setEditorEvents()
<private> Object setFullHTML(<String> html)
html
-
<private> void setHTML(<String> html)
html
- new content, should have been run through inwardHtml() first
void setLoadingMessage(string)
Object setMode(<String> mode)
mode
- optional "textmode" or "wysiwyg", if omitted, toggles between modes.
void showPanel(<DomNode> panel)
panel
- object as returned by Xinha.prototype.addPanel()
void showPanels(<Array> sides)
sides
- the sides on which the panels shall be hidden
void sizeEditor(<string> width, <string> height, <Boolean> includingBars, <Boolean> includingPanels)
width
- optional width (CSS specification)
height
- optional height (CSS specification)
includingBars
- optional to indicate if the size should include or exclude tool & status bars
includingPanels
- optional to indicate if the size should include or exclude panels
String stripBaseURL(<String> string)
string
-
<private> void surroundHTML(startTag, endTag)
<private> void undo()
void updateToolbar(<Boolean> noStatus)
noStatus
- private use Exempt updating of statusbar
void whenDocReady(<Function> f)
f
- The function to call once the document is ready
<static> void _addClass(<DomNode> el, <String> className)
el
- The DOM element the class will be added to
className
- The class to be added
<static> void _addEvent(<DomNode> el, <String> evname, <function> func)
el
- the DOM element the event should be attached to
evname
- the name of the event to listen for (without leading "on")
func
- the function to be called when the event is fired
<static> void _addEvents(<DomNode> el, <Array> evs, <function> func)
el
- the DOM element the event should be attached to
evs
- the names of the event to listen for (without leading "on")
func
- the function to be called when the event is fired
<static> String _colorToRgb(<String|Integer> v)
v
- rgb(r,g,b) or 24bit color definition
<static> <private> DomNode _createToolbarBreakingElement()
<static> void _getback(<String> url, <Function> handler)
url
- The address for the HTTPRequest
handler
- A function that is called when an answer is received from the server with the responseText as argument
<static> Object _geturlcontent(<String> url)
url
- The address for the HTTPRequest
<static> Boolean _hasClass(<DomNode> el, <String> className)
el
- The DOM element to check
className
- The class to be looked for
<static> Object _lc(<String> string, <String> context, <Object> replace)
string
- English language string. It can also contain variables in the form "Some text with $variable=replaced text$". This replaces $variable in "Some text with $variable" with "replaced text"
context
- Case sensitive context name, eg 'Xinha' (default), 'TableOperations'...
replace
- Replace $variables in String, eg {foo: 'replaceText'} ($foo in string will be replaced by replaceText)
<static> Object _loadback(<String> url, <Object> callback, <Object> scope, <Object> bonus)
url
- Source url of the file to load
callback
- optional Callback function to launch once ready
scope
- optional Application scope for the callback function
bonus
- optional Arbitrary object send as a param to the callback function
<static> <private> Object _loadlang(<String> context,url)
context
- Case sensitive context name, eg 'Xinha', 'TableOperations', ...
<static> String _makeColor(v)
Integer
- }
<static> void _postback(<String> url, <Object> data, <Function> handler)
url
- The address for the HTTPRequest
data
- The data to be passed to the server like {name:"value"}
handler
- A function that is called when an answer is received from the server with the responseText as argument
<static> <private> void _prepareForDom0Events(el, ev)
<static> void _removeClass(<DomNode> el, <String> className)
el
- The DOM element the class will be removed from
className
- The class to be removed
<static> void _removeEvent(<DomNode> el, <String> evname, <function> func)
el
- the DOM element the event should be removed from
evname
- the name of the event the listener should be removed from (without leading "on")
func
- the function to be removed
<static> void _removeEvents(<DomNode> el, <Array> evs, <function> func)
el
- the DOM element the events should be remove from
evs
- the names of the events the listener should be removed from (without leading "on")
func
- the function to be removed
<static> Object _resolveRelativeUrl( base, url )
<static> void _stopEvent(<event> ev)
ev
- the event to be stopped
<static> void addClasses(<DomNode> el, <String> classes)
el
- The DOM element the classes will be added to
classes
- The classes to be added
<static> <private> String addCoreCSS(<String> html)
html
- optional
<static> void addDom0Event(<DomNode> el, <String> ev, <function> fn)
el
- the DOM element the event should be attached to
ev
- the name of the event to listen for (without leading "on")
fn
- the function to be called when the event is fired
<static> Boolean arrayContainsArray(<Array> a1, <Array> a2)
a1
-
a2
-
<static> Array arrayFilter(<Array> a1, <Function> filterfn)
a1
- The array to filter
filterfn
- If this function returns true, the item is added to the new array
<static> String base64_decode(<String> input)
input
-
<static> String base64_encode(<String> input)
input
-
<static> <private> Boolean checkSupportedBrowser()
<static> <private> Object cloneObject(<Object> obj)
obj
-
<static> <private> void collectGarbageForIE()
<static> Array collectionToArray(<Collection> collection)
collection
- The array to filter
<static> Object createLoadingMessage(textarea,text)
<static> void createLoadingMessages(xinha_editors)
<static> Object escapeStringForRegExp(<string> string)
string
- the string to be escaped
<static> Integer findPosX(obj)
element
- HTML Element
<static> Integer findPosY(obj)
element
- HTML Element
<static> <private> void flushEvents()
<static> <private> void free(obj, prop)
object
- The object to free memory
String
- } prop optional The property to release
<static> <private> void freeLater(obj,prop)
object
- The object to free memory
String
- } prop optional The property to release
<static> DomNode getElementById(<String> tag, <String> id)
tag
- The tag name to limit the return to
id
-
<static> Object getElementTopLeft(<DomNode> element)
element
- HTML Element
<static> Object getInnerText(<DomNode> el)
el
-
<static> String getOuterHTML(<DomNode> element)
element
- HTML Element
<static> <private> String getPluginDir(<String> pluginName)
pluginName
-
<static> XMLHTTPRequest getXMLHTTPRequestObject()
<static> Boolean hasDisplayedChildren(<DomNode> el)
el
-
<static> Boolean hasParentNode(<DomNode> el)
el
-
<static> String htmlEncode(<String> str)
str
- The unencoded input
<static> void init()
<static> Boolean isBlockElement(<DomNode> el)
el
- The DOM element to check
<static> Boolean isParaContainer(<DomNode> el)
el
- The DOM element to check
<static> Boolean loadPlugin(<String> pluginName, <Function> callback, <String> plugin_file)
pluginName
-
callback
- function to be called when file is loaded
plugin_file
- URL of the file to load
<static> Boolean loadPlugins(<Array> plugins, <Function> callbackIfNotReady)
plugins
-
callbackIfNotReady
- function that is called repeatedly until all files are
<static> void loadStyle(<String> style, <String> plugin, <String> id)
style
- name of the stylesheet file
plugin
- optional name of a plugin; if passed this function looks for the stylesheet file in the plugin directory
id
- optional a unique id for identifiing the created link element, e.g. for avoiding double loading or later removing it again
<static> <private> DomNode makeBtnImg(imgDef, doc)
<static> Object makeEditors(<Array> editor_names, <Xinha.Config> default_config, <Array> plugin_names)
editor_names
-
default_config
-
plugin_names
-
<static> Boolean needsClosingTag(<DomNode> el)
el
- The DOM element to check
<static> void notImplemented(methodName)
<static> Array objectProperties(<Object> obj)
obj
-
<static> void onload()
<static> Object pageSize(<Window> scope)
scope
- optional When calling from a popup window, pass its window object to get the values of the popup
<static> void prependDom0Event(el, ev, fn)
the
- DOM element the event should be attached to
the
- name of the event to listen for (without leading "on")
the
- function to be called when the event is fired
<static> <private> void refreshPlugin(<PluginInstance> plugin)
plugin
-
<static> Object removeClasses(<DomNode> el, classes)
el
- The DOM element the class will be removed from
className
- The class to be removed
<static> DomNode removeFromParent(<DomNode> el)
el
- The element to be removed
<static> void removeLoadingMessages(xinha_editors)
<static> Object replace(<string> id, config)
id
- id of the textarea to replace
optional
- config
<static> void replaceAll(config)
optional
- config
<static> void setLoadingMessage(string)
<static> void startEditors(<Object> editors)
editors
- As returned by Xinha.makeEditors()
<static> <private> String stripCoreCSS(<String> html)
html
-
<static> String uniq(<String> prefix)
prefix
- This string is prefixed to a running number
<static> Object viewportSize(<Window> scope)
scope
- optional When calling from a popup window, pass its window object to get the values of the popup
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |