WYSIWYG and Screenshots

Submitted by DavidW on 2011-08-26

Please please add a WYSIWYG Editor to comments function and the posibility copy and paste screenshots in to a comment. I want to donate a big fish for this features!

best regards,
David

Sorry for late response.

I'm planning to add a WYSIWYG editor in one of the next versions. Adding inline images to comments would be more complicated and would make it more like a CMS application, but perhaps displaying attached images (maybe as thumbnails) instead wouldn't be a bad idea.

Regards,
Michał

Could be a nice feature !

--
Monkey Studio IDE, a cross paltform IDE written in Qt.
Support for all relating Qt4 project type (php-qt, pyqt, qmake/c++) with powerfull plugin system.
Assistant & Designer integrated, more infos on the official web page : http://monkeystudio.org

This instruction for only Textareas in issue Attributes and Comments

download tinymce and extract
upload to root directory the tinymce folder directly

and

Paste the following code between the <head> and (before) </head> tags in common/pagelayout.html.php.

<script language="javascript" type="text/javascript" src="../../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
editor_selector :"mceEditor"
});
</script>

issue.html.php with line 27, add class mceeditor, and cols 128 and rows 20 ...

<?php
    foreach ( $attributes as $attributeId => $attribute ):
        $label = $this->tr( '%1:', null, $attribute[ 'attr_name' ] );
        $key = 'value' . $attributeId;
        if ( !empty( $multiLine[ $attributeId ] ) ):
            $form->renderTextArea( $label, $key, array( 'cols' => 128, 'rows' => 20, 'class' => 'mceEditor') );
        else:
            $form->renderText( $label, $key, array( 'size' => 60 ) );
        endif;
    endforeach
?>

and
comment.html.php with line 11, add class mceeditor...

<?php $form->renderTextArea( $this->tr( 'Comment:' ), 'commentText', array( 'cols' => 120, 'rows' => 20, 'class' => 'mceEditor' ) ); ?>

in issuedetails.html.php add htmlspecialchars_decode() commands

<table class="info-list">
<?php foreach( $attributeValues as $value ): ?>
<tr>
<td><?php echo $value[ 'attr_name' ] ?>:</td>
<td class="multi-line"><?php echo htmlspecialchars_decode($value[ 'attr_value' ]) ?></td>
</tr>
<?php endforeach ?>
</table>

in the same file too htmlspecialchars_decode() ....

<?php
    switch ( $change[ 'change_type' ] ):
    case System_Const::IssueCreated:
        echo $this->tr( 'Name' ) . ': ' . htmlspecialchars_decode($change[ 'value_new' ]);
        break;
    case System_Const::IssueRenamed:
        echo $this->tr( 'Name' ) . ': ' . htmlspecialchars_decode($change[ 'value_old' ]) . ' &rarr; ' . htmlspecialchars_decode($change[ 'value_new' ]) ;
        break;
    case System_Const::ValueChanged:
        $from = ( $change[ 'value_old' ] == '' ) ? $this->tr( 'empty' ) : '' . $change[ 'value_old' ];
        $to = ( $change[ 'value_new' ] == '' ) ? $this->tr( 'empty' ) : '' . $change[ 'value_new' ];
        echo $change[ 'attr_name' ] . ': ' . htmlspecialchars_decode($from) . ' &rarr; ' . htmlspecialchars_decode($to);
        break;
    endswitch;
?>

and same file line 147
<div class="comment-text"><?php echo htmlspecialchars_decode($item[ 'comment_text' ]) ?></div>

and finally

in style.css line white-space is must be commented under the multi-line rule

.multi-line {
*/  white-space: pre-wrap;/*
  word-wrap: break-word;
}

Sorry my English, Best Regards

Note that this is not safe - htmlspecialchars_decode circumvents the built in XSS protection in WebIssues. Also it's not compatible with the Desktop Client.

Version 1.1 will have a markup editor with basic markup (not "wysiwyg" though). The first beta will be released in two or three weeks. See this post and the following ones for more details.

Regards,
Michał