|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Xinha.Config
Defined in XinhaCore.js
Version: $Rev: 819 $ $LastChangedDate: 2007-04-20 01:20:22 +0200 (Fr, 20 Apr 2007) $
Field Summary | |
String|null |
baseHref
Specify a base href for relative links ATTENTION: this does not work as expected and needs t be changed, see Ticket #961 Default: null |
Boolean|null |
browserQuirksMode
Whether the edited document should be rendered in Quirksmode or Standard Compliant (Strict) Mode. This is commonly known as the "doctype switch" for details read here http://www.quirksmode.org/css/quirksmode.html |
<private> Object |
btn
|
Object |
btnList
The button list conains the definitions of the toolbar button. |
<private> Object |
cfg
|
Boolean |
changeJustifyWithDirection
Set this to true if you want to explicitly right-justify when setting the text direction to right-to-left Default: false |
String |
charSet
CharSet of the iframe, default is the charset of the document |
String |
colorPickerCellSize
Size of color picker cells Use number + "px" Default: "6px" |
Integer |
colorPickerGranularity
Granularity of color picker cells (number per column/row) Default: 18 |
String |
colorPickerPosition
Position of color picker from toolbar button Default: "bottom,right" |
Integer |
colorPickerSaveColors
Number of recent colors to remember Default: 20 |
Boolean |
colorPickerWebSafe
Set to true to show only websafe checkbox in picker Default: false |
Boolean |
convertUrlsToLinks
See if the text just typed looks like a URL, or email address and link it appropriatly Note: Setting this option to false only affects Mozilla based browsers. |
Object |
customSelects
?? |
Boolean |
debug
Switches on some debugging (only in execCommand() as far as I see at the moment) |
Boolean |
expandRelativeUrl
If true, relative URLs (../) will be made absolute. |
Boolean |
flowToolbars
Turning this on will turn all "linebreak" and "separator" items in your toolbar into soft-breaks, this means that if the items between that item and the next linebreak/separator can fit on the same line as that which came before then they will, otherwise they will float down to the next line. |
Object |
fontname
The fontnames listed in the fontname dropdown Default value: xinha_config.fontname = { "— font —" : '', "Arial" : 'arial,helvetica,sans-serif', "Courier New" : 'courier new,courier,monospace', "Georgia" : 'georgia,times new roman,times,serif', "Tahoma" : 'tahoma,arial,helvetica,sans-serif', "Times New Roman" : 'times new roman,times,serif', "Verdana" : 'verdana,arial,helvetica,sans-serif', "impact" : 'impact', "WingDings" : 'wingdings' }; |
Object |
fontsize
The fontsizes listed in the fontsize dropdown Default value: xinha_config.fontsize = { "— size —": "", "1 (8 pt)" : "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" }; |
Object |
formatblock
The tags listed in the formatblock dropdown Default value: xinha_config.formatblock = { "— size —": "", "1 (8 pt)" : "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" }; |
Boolean |
fullPage
If true then Xinha will retrieve the full HTML, starting with the <HTML> tag. Default: false |
Boolean |
fullScreen
Start up the editor in fullscreen mode Default: false |
Array |
fullScreenMargins
You can tell the fullscreen mode to leave certain margins on each side. The value is an array with the values for [top,right,bottom,left] in that orderDefault: [0,0,0,0] |
String |
getHtmlMethod
This determines the method how the HTML output is generated. |
String |
height
This property controls the height of the editor. Allowed values are 'auto' or a numeric value followed by px. "auto" : let Xinha choose the height to use.numeric value : forced height in pixels ('200px').Default: "auto" |
Boolean |
htmlareaPaste
Intercept ^V and use the Xinha paste command If false, then passes ^V through to browser editor widget, which is the only way it works without problems in Mozilla |
RegExp|null |
htmlRemoveTags
Remove given tags when rendering the HTML (these have to be a regexp, or null if this functionality is not desired) Default: null |
Integer|null |
iframeWidth
To make the iframe width narrower than the toolbar width, e.g. |
Object |
imgURL
|
Boolean |
killWordOnPaste
Set to true if you want Word code to be cleaned upon Paste. |
Boolean |
makeLinkShowsTarget
Enable the 'Target' field in the Make Link dialog. |
String |
mozParaHandler
Gecko only: Let the built-in routine for handling the return key decide if to enter br or p tags, or use a custom implementation. For information about the rules applied by Gecko, see Mozilla website Possible values are built-in or best |
Boolean |
only7BitPrintablesInURLs
In URLs all characters above ASCII value 127 have to be encoded using % codes Default: true |
String |
pageStyle
Raw style definitions included in the edited document When a lot of inline style is used, perhaps it is wiser to use one or more external stylesheets. To set tags P in red, H1 in blue andn A not underlined, we may do the following xinha_config.pageStyle = 'p { color:red; }\n' + 'h1 { color:bleu; }\n' + 'a {text-decoration:none; }';Default: "" (empty) |
Array |
pageStyleSheets
Array of external stylesheets to load. |
Object |
panel_dimensions
each of the panels has a dimension, for the left/right it's the width for the top/bottom it's the height. |
Object |
popupURL
|
Function |
removeToolbarElement
Alias of Xinha.Config.prototype.hideSomeButtons() |
Boolean |
sevenBitClean
If you are putting the HTML written in Xinha into an email you might want it to be 7-bit characters only. |
Boolean |
showLoading
Set to true if you want the loading panel to show at startup Default: false |
Boolean |
sizeIncludesBars
Specifies whether the toolbar should be included in the size, or are extra to it. |
Boolean |
sizeIncludesPanels
Specifies whether the panels should be included in the size, or are extra to it. |
Object |
specialReplacements
Sometimes we want to be able to replace some string in the html comng in and going out so that in the editor we use the "internal" string, and outside and in the source view we use the "external" string this is useful for say making special codes for your absolute links, your external string might be some special code, say "{server_url}" an you say that the internal represenattion of that should be http://your.server/ Example: {'external_string' : 'internal_string'} Default: {} (empty) |
Boolean |
statusBar
Enable creation of the status bar? |
Boolean |
stripBaseHref
We can strip the server part out of URL to make/leave them semi-absolute, reason for this is that the browsers will prefix the server to any relative links to make them absolute, which isn't what you want most the time. Default: true |
Boolean |
stripScripts
Set to false if you want to allow JavaScript in the content, otherwise <script> tags are stripped out. This currently only affects the "DOMwalk" getHtmlMethod. Default: true |
Boolean |
stripSelfNamedAnchors
We can strip the url of the editor page from named links (eg <a href="#top">...</a>) reason for this is that mozilla at least (and IE ?) prefixes location.href to any anchor that don't have a url prefixing them Default: true |
Array |
toolbar
This array orders all buttons except plugin buttons in the toolbar. |
String |
toolbarAlign
Set to center or right to change button alignment in toolbar |
Integer |
undoSteps
Maximum size of the undo queue Default: 20 |
Integer milliseconds |
undoTimeout
The time interval at which undo samples are taken Default: 500 (1/2 sec) |
Object |
URIs
|
Object |
version
|
String |
width
This property controls the width of the editor. Allowed values are 'auto', 'toolbar' or a numeric value followed by "px". auto : let Xinha choose the width to use.toolbar : compute the width size from the toolbar width.numeric value : forced width in pixels ('600px').Default: "auto" |
Constructor Summary | |
Xinha.Config()
This class creates an object that can be passed to the Xinha constructor as a parameter. |
Method Summary | |
void
|
addToolbarElement(id, where, position)
Helper Function: add buttons/drop-downs boxes with title or separator to the toolbar if the buttons/drop-downs boxes doesn't allready exists. |
void
|
hideSomeButtons(remove)
Call this function to remove some buttons/drop-down boxes from the toolbar. |
Object
|
registerButton(id, tooltip, image, textMode, action, context)
Helper function: register a new button with the configuration. |
void
|
registerDropdown(object)
The following helper function registers a dropdown box with the editor configuration. |
Field Detail |
String|null baseHref
null
Boolean|null browserQuirksMode
<private> Object btn
Object btnList
<private> Object cfg
Boolean changeJustifyWithDirection
false
String charSet
String colorPickerCellSize
"6px"
Integer colorPickerGranularity
18
String colorPickerPosition
"bottom,right"
Integer colorPickerSaveColors
20
Boolean colorPickerWebSafe
false
Boolean convertUrlsToLinks
true
Object customSelects
{}
Boolean debug
true
Boolean expandRelativeUrl
true
Boolean flowToolbars
true
Object fontname
xinha_config.fontname = { "— font —" : '', "Arial" : 'arial,helvetica,sans-serif', "Courier New" : 'courier new,courier,monospace', "Georgia" : 'georgia,times new roman,times,serif', "Tahoma" : 'tahoma,arial,helvetica,sans-serif', "Times New Roman" : 'times new roman,times,serif', "Verdana" : 'verdana,arial,helvetica,sans-serif', "impact" : 'impact', "WingDings" : 'wingdings' };
Object fontsize
xinha_config.fontsize = { "— size —": "", "1 (8 pt)" : "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" };
Object formatblock
xinha_config.formatblock = { "— size —": "", "1 (8 pt)" : "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" };
Boolean fullPage
false
Boolean fullScreen
false
Array fullScreenMargins
[top,right,bottom,left]
in that order[0,0,0,0]
String getHtmlMethod
DOMwalk | This is the classic and proven method. It recusively traverses the DOM tree and builds the HTML string "from scratch". Tends to be a bit slow, especially in IE. |
TransformInnerHTML | This method uses the JavaScript innerHTML property and relies on Regular Expressions to produce clean XHTML output. This method is much faster than the other one. |
"DOMwalk"
String height
"auto"
: let Xinha choose the height to use.numeric value
: forced height in pixels ('200px')."auto"
Boolean htmlareaPaste
false
RegExp|null htmlRemoveTags
null
Integer|null iframeWidth
true
Object imgURL
Boolean killWordOnPaste
true
Boolean makeLinkShowsTarget
true
String mozParaHandler
"best"
Boolean only7BitPrintablesInURLs
true
String pageStyle
xinha_config.pageStyle = 'p { color:red; }\n' + 'h1 { color:bleu; }\n' + 'a {text-decoration:none; }';Default:
""
(empty)
Array pageStyleSheets
xinha_config.pageStyleSheets = ["/css/myPagesStyleSheet.css","/css/anotherOne.css"];Default:
[]
(empty)
Object panel_dimensions
xinha_config.panel_dimensions = { left: '200px', // Width right: '200px', top: '100px', // Height bottom: '100px' }
Object popupURL
Function removeToolbarElement
Boolean sevenBitClean
false
Boolean showLoading
false
Boolean sizeIncludesBars
true
Boolean sizeIncludesPanels
true
Object specialReplacements
{'external_string' : 'internal_string'}
{}
(empty)
Boolean statusBar
true
Boolean stripBaseHref
true
Boolean stripScripts
true
Boolean stripSelfNamedAnchors
true
Array toolbar
xinha_config.toolbar = [ ["popupeditor"], ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"], ["separator","forecolor","hilitecolor","textindicator"], ["separator","subscript","superscript"], ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"], ["separator","insertorderedlist","insertunorderedlist","outdent","indent"], ["separator","inserthorizontalrule","createlink","insertimage","inserttable"], ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]), ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"], ["separator","htmlmode","showhelp","about"] ];
String toolbarAlign
Integer undoSteps
20
Integer milliseconds undoTimeout
500
(1/2 sec)
Object URIs
Object version
String width
auto
: let Xinha choose the width to use.toolbar
: compute the width size from the toolbar width.numeric value
: forced width in pixels ('600px')."auto"
Constructor Detail |
Xinha.Config()
Method Detail |
void addToolbarElement(id, where, position)
void hideSomeButtons(remove)
Object registerButton(id, tooltip, image, textMode, action, context)
config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...}); config.registerButton({ id : "my-hilite", // the ID of your button tooltip : "Hilite text", // the tooltip image : "my-hilite.gif", // image to be displayed in the toolbar textMode : false, // disabled in text mode action : function(editor) { // called when the button is clicked editor.surroundHTML('', ''); }, context : "p" // will be disabled if outside aelement });
void registerDropdown(object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |