https://bugzilla.wikimedia.org/show_bug.cgi?id=3821





--- Comment #20 from Philippe Verdy <[email protected]>  2010-01-19 17:42:04 
UTC ---
As an alternative, if space separation is not an option to separate sequences,
because character lists within <charinsert> are preferably packed as much as
possible like:
<charinsert>a-zA-Z àÀâÂäÄ çÇ éÉèÈêÊëË îÎïÎ ôÔöÖ
ùÙûÛüÜ ÿŸ</charinsert>
where the extensions (<char>, <ctrl>, <comb>, <q> elements above) are just
present when needed, then text elements contained (separately from the <char>,
<ctrl> and <comb>) will be parsed specially: spaces will be ignored there,
unless they are specified as a content-less <space> element.

The only way to separate elements that must contain several characters
(including spaces) that must be inserted as whole will be to separate them by
embedding them within <char>, <ctrl> or <comb> subelements as above. So when
parsing the text child elements of <charinsert>, what we get is a list of
isolated Unicode characters (which are implicitly converted as if they were
each within a <char> child element, unless they are combining or controls
according to their Unicode properties, in which case they are converted into
the relevant <comb> or <ctrl>), and of <char> elements (or <ctrl> or <comb>
elements) or <space>. The list is explicitly ordered for the default display
order (but the user interface may allow this list to be sorted differently,
without having to edit it).

An interesting option, for speciying ranges of characters is to support the A-Z
syntax, in the text child elements of <charinsert> only (but not within the
child elements of <char>, <ctrl> or <comb> which can only be used for a single
unbreakable sequence, and not in <space> which is empty or in <q> which is used
for displaying ignorable characters, and not in the "alt=" and "title="
attributes above). In that case the MINUS-HYPHEN (-) is a syntaxic character
whcih is only valid between two isolated Unicode characters. To specify a
literal minus-hyphen as an insert string, use a <char>-</char>.

To specify a litteral string to insert (for example a wikitable), use also
<char> as in:
<charinsert>
<char title="insert a wikitable" alt="Table">{|class="wikitable"
|-
! Head1 !! Head2
|-
| Cell1 || Cell2
|}
</char>
</charinsert>

It may also be interesting to use an image/icon instead of a "alt" text
(rendered in a small font within the selector table cell). Instead of using
<char> or <ctrl> or <comb>, use an <icon> element instead, whose child text
element will be the text to insert in the wiki editor:

<!ELEMENT charinsert ((#PCDATA | space | char | comb | ctrl | icon)*) ><!-- new
definition here: adding space -->
...
<!ELEMENT icon ((#PCDATA | space)*) >
<!ATTRIB  icon
  title #PCDATA IMPLIED <!-- default is empty: the descriptive hint -->
  alt #PCDATA IMPLIED <!-- default is empty: a small alternative text if the
image can't be loaded -->
  src #PCDATA IMPLIED <!-- URI : a page name URN
  ...
>

As the default rendering of <charinsert> would probably generate a list of
table cells, it may need other things such as the maximum number of cells to
render in each row, and row breaks, or row (unselectable) headers for subgroups
of characters or strings.

Adding headers will be tricky, becauser it can be any kind of visual content in
the GUI, so it may be any mix of HTML and or Wiki... but may be it can be
restricted to only basic group titles (and the Wiki parser will generate the
appropriate interface for the characters selector). Groups could be for example
the name of a script, or the name of a language or orthography or notation
which needs those characters or strings to insert.

Generally, we'll have a list of groups (possibly rendered as a combo box within
a <select> form input element). But it may contain optional subgroups (for
example in the larget sets of ideograms or Hangul syllables, or within the
Latin script group for romanized languages). The purpose of the <charinsert> is
of course to be able to generate a form with clickable buttons. It should be
able to generate arbitrary list of buttons and allow them to be structured and
possibly not all displayed at the same time: if a group is selected, it will
replace the other list of subgroups currently displayed for another group
currently selected at the same level. Comboboxes are not necessarily the best
option (for usability), as they can also be replaced by a horizontal "ribbon"
that can list either a list of individual buttons (instances of <char>, <ctrl>,
<comb>, <space>), or other subgroups, all listed inline within it: pressing a
subgroup will just activate another ribbon at the lower level, and ribbons can
be stacked vertically.

In that case we'll have recursively:

<!ELEMENT charinsert ((charinsert | #PCDATA | space | char | comb | ctrl |
icon)*) ><!-- new -->

And to name each group, all that is required is that the <charinsert> element
itself also has the "title=" attribute for the description hint (which should
then be required), and the "alt=" for the text rendered for the group header
itself (optional, default will be the same as the title).

Will it need an icon rendered instead of this title text ? Would it need more
HTML/CSS rendering, we could then allow the <charinsert> to contain a <caption>
element as its first child, and whose content will be rendered instead of the
title, and that will contain arbitrary HTML/CSS code including images. If that
"rich" caption cannot be rendered, the title should still be present and used
(for example when rendering a <charinsert> that represents a group (without any
subgroup), as a named item within a combo-box generated from a higher-level
<charinsert> container allowing to select within a list of groups). Comboboxes
are precious to save screen space, but their rendering is more limited than
general ribbons (toolbars, or blocks of inlineelements) as they can only show
short strings of text with limited formatting.

It may also be interesting to allow other dynamic actions, when the table cell
or button or span is clicked: by default it uses a Javascript charsinsert()
event, but why not allowing something else such as calling custom Javascript?
In that case, <charinsert> could use an optional attribute containing the
default javascript event to call, which would be inherited by all elements in
its parsed list of characters or strings, and the same attribute could be
overriden by specifying it within <char>, or <ctrl>, or <comb> or <space>. This
optional attribute should be onclick="", (and there may optionally be
onmousehover="" and so on).

We could also have CSS attributes, for the <charinsert> element (specifying the
default CSS attributes of each generated button) or specifically for each of
<char>, <ctrl>, <comb> and <space> children elements (if we assume that each of
them will visually generate a table cell (i.e. a rectangular inline span,
containing one or more visual blocks). But I don't think that the <charinsert
should contain any CSS element for the whole container (it will probably
generate an inline span, and if needed it can be formatted by including it
within a usual HTML <span> or <div> element.



-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to