Annotation of kupu/plone/wysiwyg_support.kupu, revision 1.1

1.1     ! dwinter     1: <kupu:feature
        !             2:     name="wysiwyg_support"
        !             3:     implementation="plone"
        !             4:     xmlns="http://www.w3.org/1999/xhtml"
        !             5:     xmlns:kupu="http://kupu.oscom.org/namespaces/dist"
        !             6:     xmlns:tal="http://xml.zope.org/namespaces/tal"
        !             7:     xmlns:metal="http://xml.zope.org/namespaces/metal"
        !             8:     xmlns:i18n="http://xml.zope.org/namespaces/i18n"
        !             9:     >
        !            10:   <kupu:id>$Id: wysiwyg_support.kupu 15258 2005-07-28 15:08:12Z duncan $</kupu:id>
        !            11: 
        !            12:   <kupu:part name="editorbox">
        !            13: 
        !            14:     <div metal:define-macro="wysiwygEditorBox" id="kupu-editor"
        !            15:         tal:define="name fieldName|inputname;
        !            16:                 editorid string:kupu-editor-${name}"
        !            17:         tal:attributes="id editorid">
        !            18:      <tal:usekupu define="fname fieldName|inputname|nothing;
        !            19:                   usekupu python:here.contentUsesKupu(fname);">
        !            20:       <div tal:condition="usekupu">
        !            21:         <kupu:define-slot name="has_kupu" />
        !            22:       </div>
        !            23: 
        !            24:       <div tal:condition="not:usekupu">
        !            25:         <kupu:define-slot name="not_has_kupu" />
        !            26:       </div>
        !            27:      </tal:usekupu>
        !            28:     </div>
        !            29:   </kupu:part>
        !            30: 
        !            31:   <kupu:part name="eventhandler">
        !            32:     <script type="text/javascript"
        !            33:       tal:content="string:
        !            34:       addEventHandler(window, 'load',  function() {
        !            35:           window.kupu = initPloneKupu('${editorid}');
        !            36:           window.kupuui = window.kupu.getTool('ui');
        !            37:           window.drawertool = window.kupu.getTool('drawertool');
        !            38:           window.kupu.initialize();}  , document);"></script>
        !            39:   </kupu:part>
        !            40: 
        !            41:   <kupu:part name="textarea">
        !            42:     <textarea
        !            43:         cols="80"
        !            44:         rows="25"
        !            45:         tabindex=""
        !            46:         name="fieldName"
        !            47:         tal:content="inputvalue"
        !            48:         tal:attributes="name fieldName|inputname;
        !            49:                         id fieldName|inputname;
        !            50:                         onfocus onfocus|nothing;
        !            51:                         onblur onblur|nothing;
        !            52:                         tabindex tabindex|nothing;
        !            53:                         rows rows|default;
        !            54:                         cols cols|default;">
        !            55:     </textarea>
        !            56:   </kupu:part>
        !            57: 
        !            58:   <kupu:part name="textformatselector">
        !            59: 
        !            60: <div metal:define-macro="textFormatSelector" class="field">
        !            61:  <tal:usekupu define="fname fieldName|inputname|nothing;
        !            62:               usekupu python:here.contentUsesKupu(fname);">
        !            63:   <tal:editor tal:condition="usekupu">
        !            64:      <input type="hidden" name="text_format" value="text/html"
        !            65:         tal:define="fieldName fieldName|inputname|nothing;
        !            66:                 val python:fieldName and 'text/html' or 'html';
        !            67:                 fieldName python:fieldName and fieldName+'_text_format' or 'text_format';"
        !            68:         tal:attributes="name fieldName;value val;"
        !            69:      />
        !            70:   </tal:editor>                 
        !            71:   <tal:noeditor  tal:condition="not:usekupu">
        !            72:     <tal:archetypes tal:condition="fieldName|nothing">
        !            73:          <div metal:use-macro="here/widgets/visual/macros/area_format" />
        !            74:          <span tal:condition="python:portal.kupu_library_tool.isKupuEnabled(REQUEST=context.REQUEST)"
        !            75:                 tal:define="global kupu_convert_message_generated python:True">
        !            76:            <a href="#"
        !            77:                 tal:attributes="href string:${request/URL0}?kupu.convert=${fieldName};">Convert to HTML and edit with Kupu</a></span>
        !            78:     </tal:archetypes>
        !            79:     <tal:nonat condition="not:fieldName|nothing">
        !            80:      <label for="text_format" i18n:translate="label_format">Format</label>
        !            81: 
        !            82:      <div class="formHelp" i18n:translate="help_format">
        !            83:        If you are unsure of which format to use, just select Plain
        !            84:        Text and type the document as you usually do.
        !            85:      </div>
        !            86: 
        !            87:      <input class="noborder"
        !            88:             type="radio"
        !            89:             name="text_format"
        !            90:             value="structured-text"
        !            91:             tabindex=""
        !            92:             id="cb_structuredtext"
        !            93:             tal:attributes="checked python:test(text_format=='structured-text', 1, None);
        !            94:                             tabindex tabindex;"
        !            95:             />
        !            96:      <label for="cb_structuredtext" i18n:translate="structured_text">Structured Text</label> <br />
        !            97: 
        !            98:      <input class="noborder"
        !            99:             type="radio"
        !           100:             name="text_format"
        !           101:             value="html"
        !           102:             tabindex=""
        !           103:             id="cb_html"
        !           104:             tal:attributes="checked python:test(text_format=='html', 1, None);
        !           105:                             tabindex tabindex;"
        !           106:             />
        !           107:      <label for="cb_html" i18n:translate="html">HTML</label> <br />
        !           108: 
        !           109:      <input class="noborder"
        !           110:             type="radio"
        !           111:             name="text_format"
        !           112:             value="plain"
        !           113:             tabindex=""
        !           114:             id="cb_plain"
        !           115:             tal:attributes="checked python:test(text_format=='plain', 1, None);
        !           116:                             tabindex tabindex;"
        !           117:             />
        !           118:      <label for="cb_plain" i18n:translate="plain_text">Plain Text</label>
        !           119:     </tal:nonat>
        !           120:   </tal:noeditor>
        !           121:  </tal:usekupu>
        !           122: </div>
        !           123: 
        !           124:   </kupu:part>
        !           125: 
        !           126: </kupu:feature>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>