Krang::ElementClass::PoorText - WYSIWYG element
$class = pkg('ElementClass::PoorText')->new( name => "paragraph", type => 'textarea', commands => 'all_xinha', bulk_edit_tag => 'p', );
This element provides a WYSIWYG text editor for HTML by integrating with the PoorText WYSIWYG element. It is based on Krang::ElementClass::_PoorTextBase.
All the normal Krang::ElementClass attributes are available, plus:
basic => [ qw(bold italic underline cut copy paste add_html delete_html add_story_link redo undo help toggle_selectall) ], basic_with_special_chars => [ qw(bold italic underline cut copy paste add_html delete_html add_story_link redo undo specialchars help toggle_selectall) ], all_xinha => [ qw(bold italic underline strikethrough subscript superscript cut copy paste add_html delete_html add_story_link redo undo specialchars help toggle_selectall) ], all => [ qw(bold italic underline strikethrough subscript superscript cut copy paste align_left align_center align_right justify indent outdent add_html delete_html add_story_link redo undo specialchars help toggle_selectall) ],
Most of these commands should be self-evident. Some, however, are not:
Note the difference between all_xinha
and all
. The former
includes all commands supported when integrating PoorText with
Xinha-based bulk editing, excluding the align
and indent/outdent
commands which are part of all
.
bold => 'ctrl_b', italic => 'ctrl_i', underline => 'ctrl_u', subscript => 'ctrl_d', superscript => 'ctrl_s', strikethrough => 'ctrl_t', toggle_selectall => 'ctrl_a', add_html => 'ctrl_l', delete_html => 'ctrl_shift_l', add_story_link => 'ctrl_shift_s', redo => 'ctrl_y', undo => 'ctrl_z', help => 'ctrl_h', cut => 'ctrl_x', copy => 'ctrl_c', paste => 'ctrl_v', specialchars => 'ctrl_6', align_left => 'ctrl_q', align_center => 'ctrl_e', align_right => 'ctrl_r', justify => 'ctrl_w', indent => 'tab', outdent => 'shift_tab', lsquo => 'ctrl_4', rsquo => 'ctrl_5', ldquo => 'ctrl_2', rdquo => 'ctrl_3', ndash => 'ctrl_0',
(See htdocs/poortext/src/poortext_core.js for more information)
As a PoorText field may contain HTML inline-level tags only, the set
of values allowed for the option bulk_edit_tag
is limited to:
p, h1, h2, h3, h4, h5, h6, address, pre
(Un)ordered lists and tables are not allowed. For (un)ordered lists see Krang::ElementClass::PoorTextList.
The base class Krang::ElementClass::_PoorTextBase and the PoorText source in htdocs/poortext/src/.