View Issue Details

IDProjectCategoryView StatusLast Update
0012325mantisbtuipublic2018-03-28 21:59
ReportercasAssigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.2.2 
Target VersionFixed in Version 
Summary0012325: Adding WYSIWYG editor to text areas
Description

Have been playing with this feature and inially it is working ok.
I used the TinyMCE editor.
What to do :
Simply copy the editor files into the javascript directory so you end up with a structure like:
Javascript
-TinyMCE
---Langs
---Plugins

In order to actyivate BBCODE install the available BBCODE plugin.
This plugin requires 3 additional lines in order to facilitate Code en Quote options.
In config_inc.php add this line:
$g_use_wysiwyg = ON ;

Steps To Reproduce

in bbcode.php From the plugin) add these 3 lines (around line 26):
$p_string = str_replace("\n","",$p_string);
$p_string = preg_replace( '/[code](.+)[\/code]/im', "<pre>\$1</pre>", $p_string );
$p_string = preg_replace( '/[quote](.+)[\/quote]/im', "<p>Quote:<br /><blockquote>\$1</blockquote></p>", $p_string );

Additional Information

Just as a very simple solution to ensure availability on all places, i added the following code to core.php (no that is not where it should be, but for this purpose, it simply worked):
if ( ON == config_get('use_wysiwyg')){
?>
<!-- TinyMCE -->
<script type="text/javascript" src="./javascript/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "bbcode",
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,image,forecolor,styleselect,removeformat,cleanup,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "bottom",
theme_advanced_toolbar_align : "center",
theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
content_css : "css/bbcode.css",
entity_encoding : "raw",
add_unload_trigger : false,
remove_linebreaks : false,
inline_styles : false,
convert_urls : false
});
</script>
<!-- /TinyMCE -->
<?PHP
}

TagsNo tags attached.

Relationships

related to 0017920 closedjoel Native markdown support 
has duplicate 0012744 closeddregad WYSIWYG editor integration 
has duplicate 0020167 closedatrol Code/Syntax highlighter 
has duplicate 0022162 closedatrol WYSIWYG plugin 
has duplicate 0022365 closedatrol WYSIWYG editor And Paste Picture 

Activities

cas

cas

2010-09-13 02:36

reporter   ~0026695

Will become available as plugin. Now looking into the option of adding Highlight functionality (incorporating Geshi or another tool).

TomR

TomR

2011-01-03 11:34

reporter   ~0027786

Hello Cas,

how is this plugin progressing? I am very interested in this feature. There is another Wysiwyg plugin, but that seems to have some trouble.

Are there more features available in this TinyMCE editor, like Cut, Copy, Paste?

The only thing I do not fully understand is what you above describe in Steps to reproduce: I seem not able to use the code and blockquote options.

thomasb

thomasb

2011-01-06 01:37

reporter   ~0027818

Have a look on http://www.mantisbt.org/forums/viewtopic.php?f=4&amp;t=3086 - see thomasbrooks's note there.

cas

cas

2011-01-06 08:16

reporter   ~0027823

One of the issues I was encountering, is malformed emails after activating TinyMCE. Will try again with the suggestions from Thomas.

cas

cas

2011-01-12 07:28

reporter   ~0027911

The solution from Thomas works also only "onscreen". Once you send out emails, they are malformed with the html codes.
This is exactly the same issue I had. Incorporating such editor has more impact than initially expected.

dregad

dregad

2011-01-12 10:13

developer   ~0027912

Hi cas,

Not sure how easily this could be adapted or integrated with your plugin, but maybe you could use something like http://www.chuggnutt.com/html2text.php to convert TinyMCE html to "formatted" plain text. That would require some work on the email API (not sure if there are any usable plugin hooks in there)

D

cas

cas

2011-01-12 10:43

reporter   ~0027913

Currently the only hooks available are to include/exclude people from the recipients list. It looks like it can be handled by simply(?) adjusting the function "email_send".
I will give this another shot once i find some time. Sofar the only problem area is with the mail function. If people see other possible issues, please list them out.

cas

cas

2011-01-13 06:01

reporter  

Wysiwyg100.zip (7,458 bytes)
cas

cas

2011-01-13 06:07

reporter   ~0027924

Last edited: 2011-01-13 06:08

View 2 revisions

Here is the plugin for mantis 1.2.* to achieve wysiwyg functionality in Mantis.
In order to keep the emails ok, I have defined an event in email_api.php which allows to handle the body of the email. Using indeed (thanks dregad) html2text, the body is converted to plain text.
Apparently there is an option to send out HTML enabled email but this has been hardcoded set to 'false'. Not sure why this was hardcoded as such (if time permits, will investigate it).
tiny_mce needs to be downloaded and placed within the mantis javascript directory. Please see doc for correct place.
There is nothing to configure to this plugin, should work out of the box, after proper installation.

Highlighting is not part of this plugin, not even sure if it makes sense to add it anyway.

thomasb

thomasb

2011-01-13 16:18

reporter   ~0027930

Hello cas!
Thanks for the plugin!
I've noticed the email problem and same problem exists by RSS as well.
Using html2text, ot isHTML(true), solves the html tags problem, but detroyes the entire design of the email, which is meaningful in the Issue History part, for example.

We should find a way to translate only the html tags inside text areas, such as Description, Steps to Reproduce, Notes etc. to text, without the price of destroying the mail design.

html2text may be considered for the RSS, where there isn't any special design.

cas

cas

2011-01-17 04:01

reporter   ~0027960

Last edited: 2011-01-17 04:02

View 2 revisions

I need to check the linebreak functionality, that is where something is going wrong.
To be continued.....

yar

yar

2011-01-29 16:06

reporter   ~0028113

Last edited: 2011-01-29 16:08

View 2 revisions

Hi cas and MantisBT community,
yes, i also met extra linebreak (br /) problem when I inserted TinyMCE. To solve it I simply commented all lines like this
$t_string = string_nl2br( $t_string );
in plugins\MantisCoreFormatting\MantisCoreFormatting.php
(3 times in that file). The database does not have this (br /) in fields. This is just a problem of output formatting. (I used round braces as replacement of angle braces in my post ) HTH.

cas

cas

2011-01-31 04:58

reporter  

Wysiwyg_distro101.zip (1,562,043 bytes)
cas

cas

2011-01-31 05:01

reporter   ~0028116

Attached a full WYSIWYG set, version 1.01, which should cover most of the issues mentioned so far.
The solution given by yar works perfectly (till now)on the linebreaks.
Added a solution on RSS which needs to be verified.
In the distro also the main 2 core files that i have changed including the Tiny_mce set.

TomR

TomR

2011-02-01 05:18

reporter   ~0028139

Last edited: 2011-02-01 05:31

View 2 revisions

When I now use this: the remove of all formatting in the email Fix_body function will result in 1 long line for my email ( it seems NewLines and BReaks are removed ). So my email is not readable anymore.

What I am missing?

cas

cas

2011-02-01 06:07

reporter   ~0028140

Last edited: 2011-02-01 06:12

View 5 revisions

Tom,
did you made the adjustment to the MantisCoreFormatting plugin as described in the docs (or in note 0012325:0028113 )?

TomR

TomR

2011-02-01 06:32

reporter   ~0028141

Last edited: 2011-02-01 08:02

View 2 revisions

Cas, I tried that without luck.

I am now testing with HTLM on in the emails:

$mail->IsHTML( true );

However the only thing not working is: line 1358 email_api.php

return utf8_str_pad( lang_get( $attribute_id ) . ': ', config_get( 'email_padding_length' ), ' ', STR_PAD_RIGHT ) . $p_visible_bug_data[$attribute_id] . "\n";

It is not filling with spaces aligned to the right. It only uses 1 space. However if you take another character, it seems to work. Strange?

TomR

TomR

2011-02-01 14:05

reporter   ~0028142

Can anyone verify if this plugin does disables you graphs? Both my relationship graphs as well as the other graphs are not working anymore with this plugin installed.

cas

cas

2011-02-02 06:04

reporter   ~0028143

Tom,
yep you are right, it "screws" the graphs.
Need to dive into that.

atrol

atrol

2011-02-02 06:38

developer   ~0028144

Last edited: 2011-02-02 06:44

View 2 revisions

just a guess, I didn't try
remove the tabs at the beginning of line 55 of Wysiwyg.php (in front of <?PHP)

cas

cas

2011-02-02 08:47

reporter   ~0028146

Tried that but, unfortunately, no effect.
Once Tiny_mce loaded the graphs fail.
Actually unloaded the plugin and loaded tiny_mce within core.php directly, same effect.
Somewhere a compatibility issue.
Currently also looking at alternate editor

cas

cas

2011-02-03 03:27

reporter   ~0028147

Last edited: 2011-02-03 04:01

View 3 revisions

Using WYZZ, NICEDIT, CKEDITOR or XINHA has the same effect.
Looks like that any java script editor is messing with the graphs.
Anyone a suggestion for an editor that i could try ?

cas

cas

2011-02-07 02:52

reporter   ~0028172

Contacted the graphviz guys if they receognized this incompatibility but unfortunately they do not.
Noticed there is someone else working on a similar thing ( 0012744 ).

If someone has a clue, let us know.

yar

yar

2011-02-07 03:00

reporter   ~0028173

Hi cas and MantisBT community,
I met 2 more painful bugs if I use TinyMCE in Mantis.
The problem appears in IE7 (only) or if you set up IE8 to
work in a mode of IE7 (Tools, Developer Tools, Browser Mode: IE7).
(If standard mode IE8 is on, than this bug does not appears, all works fine).

bug 1. On page Report Issue (bug_report_page.php), I full-fill Summary
and Description as mandatory fields. I enter some text to both fields but when I press [Submit Report] button, than this error message appears:

APPLICATION ERROR #11
A necessary field "Description" was empty. Please recheck your inputs.
Please use the "Back" button in your web browser to return to the previous page. ...

And the Issue is not saved and if I click [Back] button, than field 'Description' (where TinyMCE is placed) is blank (field Summary has the entered text).
So, I suppose on [Submit Report] there is no text comes from TinyMCE, so this result this error.

bug 2. On page Updating Issue Information (bug_update_page.php), where I can update all information related to the issue, only field Description has TinyMCE editor. Fields Steps To Reproduce, Additional Information, Add Note has simple text box area. (not TinyMCE as it should be). And, the Description field is blank (it should be populated with the text (entered earlier in another browser)).
If I click [Update Information] than no message appears, but fields Description
is not saved.

Any suggestion how to fix this will be appreciated.

cas

cas

2011-02-07 03:52

reporter   ~0028174

@yar,
I cannot reproduce this behavior. Have tried this in ie8 with & without compatibility mode. You are also using 1.2.4?

Nevertheless as long as the issue with the graphs is not solved, this plugin is not suitable for production systems.

yar

yar

2011-02-07 04:11

reporter   ~0028175

Last edited: 2011-02-13 08:25

View 2 revisions

@cas,
thanks for quick answer. Yes, I use 1.2.4. I simply met this when I have to use IE7 (and no other browser were available at that place). And than reproduced this in IE8 working in IE7 mode. Not sure however that I use exactly the same configuration/files/etc. of this plugin (may be something custom made) - will check at the week.
Update: I checked, it looks like the configuration is the same. But my problem is that mantisbt (and TinyMCE) is installed in subdomain, like sub.domain.info. It looks like it results to problems. I tried to use parameters like
script_url: 'javascript/tiny_mce/tiny_mce.js',
document.domain : 'sub.domain.info',
document_base_url : \"http://sub.domain.info/\&quot;
in tinyMCE.init() (in function html_head_begin()), and played a bit with different combination (also without document.domain for example), but it does not helped. (I used versions of TinyMCE: 3.3.9.3 and the latest 3.4b3)

Mete

Mete

2011-10-18 15:38

reporter   ~0029988

Last edited: 2011-10-18 15:41

View 2 revisions

@cas

Is it possible to have a setting that can be instantly display completely. The default is yes, the small toolbar or reduced (no picture uploading, code php, etc.) to see.

cas

cas

2011-10-20 08:28

reporter   ~0030006

Think that is possible but lately I have not done much work on this since it was messing up my graphics.

michael-milette

michael-milette

2014-03-27 11:11

reporter   ~0039747

Hi Cas,

Thank you for making this plugin available. I wish such functionality was integrated into the core MantisBT code.

I recently adapted the plugin for my own use. Changes include the following:

  • Updated for the latest MantisBT 1.2.17 (was 1.2.4).
  • Updated to the latest TinyMCE to 3.5.10 (was 3.3.9).
  • All modifications to MantisBT are included for easier installation. You no longer need to modify any files. Just copy in place, activate it and it works!
  • You can now easily enable/disable WYSIWYG editor by setting $g_use_wysiwyg = ON (enabled) or OFF (disabled) in config_inc.php.
  • Set the editor width to always be 100%.
  • Set minimum height to 230px.
  • Now ends container block elements when pressing enter inside an empty block.
  • Reorganized the editor's toolbar icons and added a few new ones.

In order to share these changes, I would need to know, under what license you are making your plugin available?

Both MantisBT and TinyMCE 3.x are licensed under the GNU license. Can I assume your plugin falls under the same?

Thanks again for this very useful plugin.

Best regards,

Michael

atnz

atnz

2014-05-25 15:26

reporter   ~0040636

Hi Michael, Can you upload your files? We are also really interested in WYSIWYG in the notes and description fields. Does yours work if you copy text from a web page and then paste into the text box? or do you get a whole bunch of HTML control characters?

mfernau

mfernau

2015-11-21 08:00

reporter   ~0051912

It would be nice to have such an editor in one of the upcoming Mantis releases.

Or make Mantis graphics compatible so that TinyMCE can be used as such an editor (see 0012325:0030006)

atnz

atnz

2017-01-08 15:37

reporter   ~0054980

With v2.0 and it being 2017.... Surely WYSIWYG controls for text should be standard?

kierun

kierun

2017-02-09 07:58

reporter   ~0055612

Any updates on this at all since there is markdown native support in 2.1.0?

atnz

atnz

2017-02-23 01:16

reporter   ~0055751

Any news on this?

hdueo

hdueo

2018-03-28 21:59

reporter   ~0059344

news?

Issue History

Date Modified Username Field Change
2010-09-08 06:48 cas New Issue
2010-09-13 02:36 cas Note Added: 0026695
2011-01-03 11:34 TomR Note Added: 0027786
2011-01-06 01:37 thomasb Note Added: 0027818
2011-01-06 08:16 cas Note Added: 0027823
2011-01-12 07:28 cas Note Added: 0027911
2011-01-12 10:13 dregad Note Added: 0027912
2011-01-12 10:43 cas Note Added: 0027913
2011-01-13 06:01 cas File Added: Wysiwyg100.zip
2011-01-13 06:07 cas Note Added: 0027924
2011-01-13 06:08 cas Note Edited: 0027924 View Revisions
2011-01-13 16:18 thomasb Note Added: 0027930
2011-01-17 04:01 cas Note Added: 0027960
2011-01-17 04:02 cas Note Edited: 0027960 View Revisions
2011-01-29 16:06 yar Note Added: 0028113
2011-01-29 16:08 yar Note Edited: 0028113 View Revisions
2011-01-31 04:58 cas File Added: Wysiwyg_distro101.zip
2011-01-31 05:01 cas Note Added: 0028116
2011-02-01 05:18 TomR Note Added: 0028139
2011-02-01 05:31 TomR Note Edited: 0028139 View Revisions
2011-02-01 06:07 cas Note Added: 0028140
2011-02-01 06:10 cas Note Edited: 0028140 View Revisions
2011-02-01 06:11 cas Note Edited: 0028140 View Revisions
2011-02-01 06:11 cas Note Edited: 0028140 View Revisions
2011-02-01 06:12 cas Note Edited: 0028140 View Revisions
2011-02-01 06:32 TomR Note Added: 0028141
2011-02-01 08:02 TomR Note Edited: 0028141 View Revisions
2011-02-01 14:05 TomR Note Added: 0028142
2011-02-02 06:04 cas Note Added: 0028143
2011-02-02 06:38 atrol Note Added: 0028144
2011-02-02 06:44 atrol Note Edited: 0028144 View Revisions
2011-02-02 08:47 cas Note Added: 0028146
2011-02-03 03:27 cas Note Added: 0028147
2011-02-03 03:38 cas Note Edited: 0028147 View Revisions
2011-02-03 04:01 cas Note Edited: 0028147 View Revisions
2011-02-07 02:52 cas Note Added: 0028172
2011-02-07 03:00 yar Note Added: 0028173
2011-02-07 03:52 cas Note Added: 0028174
2011-02-07 04:11 yar Note Added: 0028175
2011-02-13 08:25 yar Note Edited: 0028175 View Revisions
2011-02-13 14:35 vboctor Relationship added related to 0012744
2011-10-18 15:38 Mete Note Added: 0029988
2011-10-18 15:41 Mete Note Edited: 0029988 View Revisions
2011-10-20 08:28 cas Note Added: 0030006
2014-03-27 11:11 michael-milette Note Added: 0039747
2014-05-25 15:26 atnz Note Added: 0040636
2014-11-25 11:47 vboctor Relationship added related to 0017920
2014-11-25 11:50 vboctor Category feature => ui
2015-03-02 08:04 vitsaadmin Issue cloned: 0019448
2015-10-02 14:39 atrol Relationship added has duplicate 0020167
2015-11-21 08:00 mfernau Note Added: 0051912
2017-01-08 15:37 atnz Note Added: 0054980
2017-01-11 01:46 atrol Relationship added has duplicate 0022162
2017-02-09 07:58 kierun Note Added: 0055612
2017-02-13 01:30 atrol Relationship added has duplicate 0022365
2017-02-23 01:16 atnz Note Added: 0055751
2017-02-23 04:36 dregad Relationship replaced has duplicate 0012744
2018-03-28 21:59 hdueo Note Added: 0059344