taqueci / redmine_wysiwyg_editor

Redmine WYSIWYG Editor plugin
GNU General Public License v2.0
114 stars 27 forks source link

Editor for notes? #123

Closed DolezalDavid closed 3 years ago

DolezalDavid commented 3 years ago

Hi @taqueci, is it possible to enable this usefull plugin for isseue's notes and wiki's comments?

Thank you for you work.

With best regards

David

taqueci commented 3 years ago

Hi @DolezalDavid

This plugin is available for issue's notes and is not available for wiki's comments. Do you mean visual editor does not appear when editing an issue? Screenshot_2021-04-27 Bug #1 Stack overlows - Foo - Redmine

DolezalDavid commented 3 years ago

hmm, interesting...

By me isn't the same as on your pic obrazek

DolezalDavid commented 3 years ago

Here is my setup obrazek

taqueci commented 3 years ago

Note to self: The issue is not reproduced.

Environment:
  Redmine version                4.2.0.stable
  Ruby version                   2.7.3-p183 (2021-04-05) [x86_64-linux-musl]
  Rails version                  5.2.5
  Environment                    production
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.14.1
  Mercurial                      5.5.2
  Git                            2.30.2
  Filesystem                     
Redmine plugins:
  redmine_custom_workflows       1.0.4
  redmine_home_page_redirector   1.0.0
  redmine_lightbox2              0.5.1
  redmine_local_avatars          1.0.5.2.0
  redmine_wysiwyg_editor         0.21.0
nanego commented 3 years ago

Same problem here after updating our main application. It seems we have to activate the "editor visual" module for ALL our projects. It's a bit fastidious as we have hundreds of them.

Fixed by updating our data:

rails console
Project.all.each { |p| p.enable_module!(:visual_editor) }
taqueci commented 3 years ago

Hi @DolezalDavid

Since 0.21.0, the visual editor is disabled as default. Please enable "Visual editor" in each project module settings if it is disabled.

DolezalDavid commented 3 years ago

@nanego Great. I used your fix, and it looks good.

Last quick question: "How to set Visual Editor for all users as default editor?" :-) Awsome work guys!

Thank you for your support.

taqueci commented 3 years ago

Hi @DolezalDavid

How to set Visual Editor for all users as default editor?

There is no way so far. You can do it by changing source code:

--- a/assets/javascripts/redmine_wysiwyg_editor.js
+++ b/assets/javascripts/redmine_wysiwyg_editor.js
@@ -197,7 +197,7 @@ RedmineWysiwygEditor.prototype.init = function(editorSetting) {
   self._defaultMode =
     (('localStorage' in window) && (window.localStorage !== null)) ? {
       get: function() {
-        return localStorage.getItem(self._defaultModeKey) || 'text';
+        return localStorage.getItem(self._defaultModeKey) || 'visual'; // Use visual editor for the first time.
       },
       set: function(mode) {
         localStorage.setItem(self._defaultModeKey, mode);

or

--- a/assets/javascripts/redmine_wysiwyg_editor.js
+++ b/assets/javascripts/redmine_wysiwyg_editor.js
@@ -197,7 +197,7 @@ RedmineWysiwygEditor.prototype.init = function(editorSetting) {
   self._defaultMode =
     (('localStorage' in window) && (window.localStorage !== null)) ? {
       get: function() {
-        return localStorage.getItem(self._defaultModeKey) || 'text';
+        return 'visual'; // Always use visual editor as default.
       },
       set: function(mode) {
         localStorage.setItem(self._defaultModeKey, mode);
DolezalDavid commented 3 years ago

@taqueci thank you! Work nice!

For me is this task complete so I close it. Thank you guys for your help! :-)