| javascript_components

# Class: Bs_Wysiwyg Source Location: /components/wysiwyg/Bs_Wysiwyg.class.js.php
### Class Overview
!!! DEPRECATED !!! #### Author(s): #### Copyright: blueshoes | ### Variables $dataContainer $dataType $editareaOnPaste $formFieldName $inHtmlMode $outrendered $registerCustom1Caption $registerCustom1Content $specialCharsSelectorUrl $style $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $tabWysiwygGroup $toolbarDoc $toolbarElm $toolbarShowButtonClose $toolbarShowButtonSave $toolbarShowButtonUndo $useRegisterCustom1 $useRegisterEasy $useRegisterEditlive $useRegisterHtml $useRegisterPlus $useRegisterScreentype $useRegisterText $useTabWysiwyg $wysiwygElm $_objectName | ### Methods addToRegisterCustom1 attachEvent drawAsToolbar drawInto fireEvent fireOnBlur fireOnFocus getValue hasEventAttached imageBrowserCallback insertHtml openImageBrowser saveCursorPos setCodeSnippets setImageBrowser setValue snippetShow snippetSwitchGroup specialCharsDoneCallback specialCharsOnloadCallback specialCharsSelectorShow toggleToolbar toolbarButtonClose toolbarButtonSave toolbarButtonUndo toolbarOnloadCallback _snippetUpdateNames
### Inherited Variables | ### Inherited Methods
### Class Details [line 109] !!! DEPRECATED !!! Bs_Wysiwyg.class.js - clientside wysiwyg editor. developed and tested using ie6. ie5 and ns6 don't work. Dependences: /_bsJavascript/core/form/Bs_FormFieldSelect.class.js, /_bsJavascript/core/html/Bs_HtmlUtil.lib.js, #### Tags:
deprecated: |
copyright: | blueshoes
[ Top ] ### Class Variables #### $dataContainer = [line 377] can be used to stick in any data. maybe you don't see a reason for it, but i do. #### Tags:
var: | dataContainer
since: | bs4.4
access: | public
Type: | mixed
[ Top ] #### $dataType = 'whtml' [line 132] the data type of the data that gets edited. one of: whtml (wysiwyg html, default) html (only html edit is possible, no wysiwyg) xhtml xml text screentype #### Tags:
access: | public
Type: | mixed
[ Top ] #### $editareaOnPaste = 5 [line 163] what should be done on a paste operation, what kind of pasts are accepted? a user can really fuck up html code by pasting parts of websites, word documents and the like. if your users are not familiar with html, you should not leave the default. pasting can be done in different ways, not only with the paste button, but also ctrl-v shift-insert right mouse, paste (contect menu the options: = no pasting allowed, just ignore it silently. = no pasting allowed, alert such a message on paste. = allow paste of plain text, remove tags silently. = allow paste of plain text, remove tags, alert such a message. = if tags are pasted, ask the user if he wants to keep them or have them removed. = just paste what's pasted, don't do anything, allow everything. or alternatively, you can set a function to this var which will then be called, and you can handle it yourself. return a text to paste, or return bool false to paste nothing. alert the user yourself if you want. #### Tags:
var: | editareaOnPaste (int or function)
since: | bs4.4
see: | this._fireEditareaOnPaste()
access: | public
Type: | mixed
[ Top ] #### $formFieldName = [line 203] if the style is set to 'inline' or 'floating' (not 'toolbar') then you can use a (hidden) form field which will be updated with the editors content (whenever the editor loses the focus). if you want that feature, specify a field name here. otherwise just leave it unset. #### Tags:
var: | formFieldName
access: | public
Type: | string
[ Top ] #### $inHtmlMode = false [line 185] if style is not set to 'toolbar' then our editor area is used for both, wysiwyg and html editing. if we're in html mode, we need to do some things differently, so we need to know. you as a coder don't need to do anything with it. #### Tags:
var: | inHtmlMode
Type: | bool
[ Top ] #### $outrendered = false [line 308] tells if we're already rendered to the browser. #### Tags:
var: | outrendered
Type: | bool
[ Top ] #### $registerCustom1Caption = 'Custom 1' [line 278] caption for the register "custom 1", if used. #### Tags:
var: | registerCustom1Caption
since: | bs4.3
access: | public
Type: | string
[ Top ] #### $registerCustom1Content = array() [line 270] content for the register "custom 1", if used. #### Tags:
var: | registerCustom1Content
see: | this.addToRegisterCustom1()
since: | bs4.3
Type: | array
[ Top ] #### $specialCharsSelectorUrl = '/_bsJavascript/components/wysiwyg/specialCharsSelector.html' [line 322] set this to bool false if you don't want to use the special-char selector. #### Tags:
var: | specialCharsSelectorUrl
access: | public
Type: | string
[ Top ] #### $style = 'inline' [line 175] how the wysiwyg editor should be displayed. 'inline' => as fixed field, non-moveable. (default) 'floating' => as box, moveable 'toolbar' => toolbar only, the editable part is directly in the page. toolbar is moveable. #### Tags:
var: | style
access: | public
Type: | string
[ Top ] #### $tabWysiwygGroup = 2 [line 358]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 357]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 355]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 354]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 359]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 356]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 362]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 366]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 367]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 364]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 363]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 361]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = array() [line 353] if the wysiwyg tab is used then this defines what buttons are used and how. #### Tags:
var: | tabWysiwygGroup (hash)
see: | var this.useTabWysiwyg
access: | public
Type: | array
[ Top ] #### $tabWysiwygGroup = 2 [line 360]
Type: | mixed
[ Top ] #### $tabWysiwygGroup = 2 [line 365]
Type: | mixed
[ Top ] #### $toolbarDoc = [line 286] a reference to the toolbar document. gets set after the toolbar got loaded. #### Tags:
see: | this.toolbarElm
access: | public
Type: | object toolbarDoc
[ Top ] #### $toolbarElm = [line 294] a reference to the toolbar element. gets set after the toolbar got loaded. #### Tags:
see: | this.toolbarDoc
access: | public
Type: | object toolbarElm
[ Top ] #### $toolbarShowButtonClose = true [line 399] show the close button in the toolbar? #### Tags:
var: | toolbarShowButtonClose
access: | public
Type: | bool
[ Top ] #### $toolbarShowButtonSave = false [line 392] show the save button in the toolbar? #### Tags:
var: | toolbarShowButtonSave
access: | public
Type: | bool
[ Top ] #### $toolbarShowButtonUndo = false [line 385] show the undo button in the toolbar? #### Tags:
var: | toolbarShowButtonUndo
access: | public
Type: | bool
[ Top ] #### $useRegisterCustom1 = false [line 213] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterCustom1
access: | public
Type: | mixed
[ Top ] #### $useRegisterEasy = 'auto' [line 229] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterEasy
access: | public
Type: | mixed
[ Top ] #### $useRegisterEditlive = false [line 245] if the editlive tab should be used or not. only makes sense if it's installed. note: in bs4.3 this has been renamed from useEditlive to useRegisterEditlive. #### Tags:
var: | useRegisterEditlive (default is false)
access: | public
Type: | mixed
[ Top ] #### $useRegisterHtml = 'auto' [line 253] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterHtml
access: | public
Type: | mixed
[ Top ] #### $useRegisterPlus = 'auto' [line 237] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterPlus
access: | public
Type: | mixed
[ Top ] #### $useRegisterScreentype = 'auto' [line 261] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterScreentype
access: | public
Type: | mixed
[ Top ] #### $useRegisterText = 'auto' [line 221] all the useRegister* vars can be set to bool false, bool true or string 'auto'. auto means show it or not based on the dataType. #### Tags:
var: | useRegisterText
access: | public
Type: | mixed
[ Top ] #### $useTabWysiwyg = [line 344] if not set then auto-behavior will be used. #### Tags:
var: | useTabWysiwyg
access: | public
Type: | bool
[ Top ] #### $wysiwygElm = [line 301] a reference to the wysiwyg element (div). gets set after the toolbar got loaded. #### Tags:
access: | public
Type: | object wysiwygElm
[ Top ] #### $_objectName = objectName [line 1064]
Type: | mixed
[ Top ] ### Class Methods ### method addToRegisterCustom1 [line 1048]
`void addToRegisterCustom1( string action, string imgName, string title, string helpText)`
adds a button to the "custom 1" register. if called without passing any parameter then a separator is included which also means that a new group of buttons is started. #### Tags:
since: | bs4.3
access: | public
#### Parameters:
string | action | action
string | imgName | imgName
string | title | title
string | helpText | helpText
[ Top ] ### method attachEvent [line 467]
`void attachEvent( string trigger, mixed yourEvent)`
attaches an event. editStart editEnd editBlur toolbarClose editareaMouseOver editareaMouseOut #### Tags:
see: | var this._attachedEvents
access: | public
#### Parameters:
string | trigger | trigger
mixed | yourEvent | yourEvent (string (of code) or function)
[ Top ] ### method drawAsToolbar [line 559]
`bool drawAsToolbar( string editableAreaId, bool startActivated)`
renders the toolbar, but it's not visible by default. use toggleToolbar(). #### Tags:
see: | Bs_Wysiwyg::toggleToolbar()
access: | public
#### Parameters:
string | editableAreaId | editableAreaId
bool | startActivated | startActivated (if it should be in edit mode after loading. default is false. also see var this._startActivated)
[ Top ] ### method drawInto [line 613]
`bool drawInto( mixed tagId)`
draws the editor into the tag specified. #### Tags:
var: | tagId
access: | public
[ Top ] ### method fireEvent [line 496]
`void fireEvent( string trigger)`
fires the events for the trigger specified. #### Parameters:
string | trigger | trigger (for example 'onClickCaption')
[ Top ] ### method fireOnBlur [line 938]
`void fireOnBlur( )`
fires when the edit area loses the focus. we have to update our internal value. and the hidden form field (since bs4.3). [ Top ] ### method fireOnFocus [line 963]
`void fireOnFocus( )`
[ Top ] ### method getValue [line 703]
`string getValue( )`
returns the value (content). #### Tags:
access: | public
[ Top ] ### method hasEventAttached [line 485]
`bool hasEventAttached( string trigger)`
tells if an event is attached for the trigger specified. #### Tags:
access: | public
#### Parameters:
string | trigger | trigger
[ Top ] ### method imageBrowserCallback [line 737]
`void imageBrowserCallback( string url)`
callback function for the image file browser. #### Parameters:
string | url | url (the image url)
[ Top ] ### method insertHtml [line 890]
`void insertHtml( mixed str)`
[ Top ] ### method openImageBrowser [line 725]
`bool openImageBrowser( )`
opens the image browser (as popup). only does it if setImageBrowser() has been used before. #### Tags:
return: | (true if it has been opened, false otherwise)
[ Top ] ### method saveCursorPos [line 923]
`void saveCursorPos( )`
saves the cursor pos of the editable field "onBeforeDeactivate". this is needed so we can insert things at the right position. [ Top ] ### method setCodeSnippets [line 769]
`void setCodeSnippets( array arr)`
sets an array with code snippets. this all only makes sense if the html tab is used. call it before calling drawInto() or so. the structure of the given array looks like this: arr[section][name][property] = value example: arr = array(); arr['site'] = array(); arr['site']['webmasterEmail'] = array(); arr['site']['webmasterEmail']['value'] = '<a href="webmaster@domain.com">Webmaster</a>'; arr['site']['webmasterEmail']['description'] = 'The main webmaster email address as link.'; arr['site']['webmasterEmail']['lastMod'] = '2002/12/31'; //just a text string, whatever arr['site']['webmasterEmail']['user'] = 'tom'; //user that last modified the snipped the "value" key is the only really needed one. an idea is to groupd snippets into "site", "page" and "user". if this method is not used, no snippets are available. #### Tags:
access: | public
#### Parameters:
array | arr | arr (see above)
[ Top ] ### method setImageBrowser [line 715]
`void setImageBrowser( string url)`
if you want to use a file browser to load images from the server, set the url here. otherwise all a user can do is type in url's himself. #### Tags:
access: | public
#### Parameters:
string | url | url
[ Top ] ### method setValue [line 685]
`bool setValue( string str)`
sets the value (content). #### Tags:
access: | public
#### Parameters:
string | str | str
[ Top ] ### method snippetShow [line 831]
`void snippetShow( string snippetName)`
shows the snippet selector. #### Parameters:
string | snippetName | snippetName
[ Top ] ### method snippetSwitchGroup [line 818]
`void snippetSwitchGroup( string groupName)`
#### Parameters:
string | groupName | groupName
[ Top ] ### method specialCharsDoneCallback [line 876]
`void specialCharsDoneCallback( mixed code)`
fires once the user selected a character. #### Parameters:
mixed | code | code (string or number)
[ Top ] ### method specialCharsOnloadCallback [line 866]
`void specialCharsOnloadCallback( )`
fires once the special chars popup finished loading. [ Top ] ### method specialCharsSelectorShow [line 853]
`void specialCharsSelectorShow( )`
shows the special char selector. [ Top ] ### method toggleToolbar [line 520]
`bool toggleToolbar( bool hide)`
toggles the visibility of the toolbar. access public #### Tags:
return: | (success or not)
see: | Bs_Wysiwyg::drawAsToolbar()
#### Parameters:
bool | hide | hide
[ Top ] ### method toolbarButtonClose [line 543]
`void toolbarButtonClose( )`
[ Top ] ### method toolbarButtonSave [line 536]
`void toolbarButtonSave( )`
[ Top ] ### method toolbarButtonUndo [line 529]
`void toolbarButtonUndo( )`
[ Top ] ### method toolbarOnloadCallback [line 658]
`void toolbarOnloadCallback( )`
fires once the toolbar [frame] got loaded. [ Top ] ### method _snippetUpdateNames [line 803]
`void _snippetUpdateNames( mixed groupName)`
[ Top ] Documentation generated on Mon, 29 Dec 2003 22:18:36 +0100 by phpDocumentor 1.2.3