Class ::xowiki::formfield::richtext::wym
::xowiki::formfield::richtext::wym
create ... \
[ -CSSclass (default "wymeditor") ] \
[ -height height ] \
[ -plugins (default "hovertools resizable fullscreen") ] \
[ -skin (default "silver") ] \
[ -width width ]
Class Relations
- class: ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::formfield::richtext
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xotcl::Class create ::xowiki::formfield::richtext::wym \
-superclass ::xowiki::formfield::richtext
Methods (to be applied on instances)
CSSclass (setter)
height (setter)
initialize (scripted)
next
set :widget_type richtext
plugins (setter)
render_input (scripted)
set disabled [:is_disabled]
if {![:istype ::xowiki::formfield::richtext] || $disabled } {
:render_as_div
} else {
::xo::Page requireCSS "/resources/xowiki/wymeditor/skins/default/screen.css"
::xo::Page requireJS urn:ad:js:jquery
::xo::Page requireJS "/resources/xowiki/wymeditor/jquery.wymeditor.pack.js"
set postinit ""
foreach plugin {hovertools resizable fullscreen embed} {
if {$plugin in [:plugins]} {
switch -- $plugin {
embed {}
resizable {
::xo::Page requireJS urn:ad:js:jquery-ui
append postinit "wym.${plugin}();\n"
}
default {append postinit "wym.${plugin}();\n"}
}
::xo::Page requireJS "/resources/xowiki/wymeditor/plugins/$plugin/jquery.wymeditor.$plugin.js"
}
}
regsub -all -- {[.:]} ${:id} {\\\\&} JID
set config [list "skin: '[:skin]'"]
if {[info exists :height] || [info exists :width]} {
set height_cmd ""
set width_cmd ""
if {[info exists :height]} {set height_cmd "jQuery(wym._box).find(wym._options.iframeSelector).css('height','[:height]');"}
if {[info exists :width]} {set width_cmd "wym_box.css('width', '[:width]');"}
set postInit [subst -nocommand -nobackslash {
postInit: function(wym) {
wym_box = jQuery(".wym_box");
$height_cmd
$width_cmd
$postinit
}}]
lappend config $postInit
}
if {$config ne ""} {
set config \{[join $config ,]\}
}
::xo::Page requireJS [subst -nocommand -nobackslash {
jQuery(function() {
jQuery("#$JID").wymeditor($config);
});
}]
next
}skin (setter)
width (setter)