Short description

Rebecca of pyCologne asked me to implement instead of the Syntax description at bottom of the text editor a tool box which inserts on clicking the input text with formatting into the textarea.

An idea how that could be solved was given by a request on SelfHtml

Here is a small example, which needs of course nice icons instead of text and some more improvement. -- ReimarBauer 2007-06-17 18:47:16

<HTML>
<script type="text/javascript">
    function wikicode(message, code_open, code_close, textarea_name)
    {
        var txt = prompt(message,"");

        if(txt)
        {
            var txt = code_open + txt + code_close;
            id = document.forms[0][textarea_name];
            id.value += txt;
            id.focus();
        }
    }
</script>

<FORM>
    <textarea name="textbox"> </textarea>
    <input type="button" value="Headings" onClick='wikicode("Headings:","= ", " =", "textbox")' />
    <input type="button" value="Bullets" onClick='wikicode("Bullets:"," * ", "", "textbox")' />
</FORM>


</HTML>

that code recognices the cursor position and coud be used for marked text too. http://aktuell.de.selfhtml.org/artikel/javascript/bbcode/

Discussion

This idea is taken from wikipedia or docuwiki. Above the input field you have a row with small icons for italic,bold... . Underneath the input field you've got the buttons for "Save" "Cancel" "Preview". You can test it here: http://de.wikipedia.org/w/index.php?title=Luigi_Groto&action=edit .

Example of docuwiki http://wiki.splitbrain.org/playground:sandbox

If I see it correctly we have a continuum of editor enrichment from simple, plain text editors up to full wysiwyg editors as follows:

I think the pros and cons of the different hybrid solution (2) and (3) a worth an indepth discussion... -- OliverSiemoneit 2007-06-17 21:01:30

Related Suggestions for Improvments


CategoryFeatureRequest

MoinMoin: FeatureRequests/TextEditorShouldUseButtonsForCommonSyntax (last edited 2007-10-29 19:08:51 by localhost)