Changes between Version 3 and Version 4 of TicketNavPlugin


Ignore:
Timestamp:
May 13, 2011, 12:26:54 PM (4 years ago)
Author:
framay
Comment:

Added documentation of component HtmlContent

Legend:

Unmodified
Added
Removed
Modified
  • TicketNavPlugin

    v3 v4  
    1616}}}
    1717
     18=== Component `HtmlContent` ===
     19Enables HTML content in description, adding Javascript editor and
     20adding additional CSS file for manipulation CSS declarations.
     21
     22Options:
     23|| '''option name''' || '''values''' || '''description''' ||
     24|| description_format || `wiki` | `html` || format for ticket description (default: '''wiki''') ||
     25|| editor_source || valid path || Usually it should stored in project or common js folder. For ckeditor for example it could be site/js/ckeditor/ckeditor.js. ||
     26|| editor_replace || valid path || Javascript, which should replace textareas. ||
     27|| additional_css || valid path || Path to additional css file, which overrides css-declarations. ||
     28
     29Sample configuration:
     30{{{
     31[ticket]
     32description_format = html
     33editor_source = site/js/ckeditor/ckeditor.js
     34editor_replace = <script type="text/javascript">CKEDITOR.replace('@FIELD_NAME@', {toolbar: 'custom'});</script>
     35additional_css = site/css/add_ticket.css
     36}}}
     37
     38In above sample configuration [http://ckeditor.com/ CKEditor] is used as online editor and
     39the editor source is located in projects-folder `htdocs/js/ckeditor`,
     40after each `textarea` with HTML-Option content of `editor_replace` will be added.
     41The file in option `additional_css` will be added and therefore will override these declarations.
     42
     43'''Attention:''' To have a correct preview, file `ticket_box.html` has to be edited:
     44{{{
     451 <py:if test="field">
     462   <py:choose test="">
     473     <py:when test="ticket[field.name] and field.format == 'html'">${wiki_to_html(context, '{{{ \n#!html \n' + ticket[field.name]  + '\n}}}', escape_newlines=preserve_newlines)}</py:when>
     484     <py:when test="'rendered' in field">${field.rendered}</py:when>
     495     <py:otherwise>${ticket[field.name]}</py:otherwise>
     506   </py:choose>
     517 </py:if>
     52}}}
     53
     54Line 3 has to be inserted into `py:choose` block in above template-snippet.
     55
     56{{{
     57<div py:if="ticket.description" class="searchable" xml:space="preserve">
     58<py:choose>
     59    <py:when test="description_format == 'html'">${wiki_to_html(context, '{{{ \n#!html \n' + ticket.description  + '\n}}}', escape_newlines=preserve_newlines)}</py:when>
     60    <py:otherwise>${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}</py:otherwise>
     61</py:choose>
     62</div>
     63}}}
     64
     65Also `py:choose` block has to be added into div-block near the end of file (see above template-snippet).
     66
     67=== Screenshots ===
     68
    1869[[Image(TextAreaDescription.png)]]
    1970
    20 ''Screenshot of text area description (red box under Beschreibung aka description)''
     71''Screenshot of `TextAreaDescription` (red box under Beschreibung aka description) and `HtmlContent` (Editor)''
    2172
    2273== Bugs/Feature Requests ==