Project

General

Profile

Actions

Patch #31385

open

Formating toolbar : new color tools

Patch #31385: Formating toolbar : new color tools

Added by Jérôme BATAILLE over 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI

Description

This patch provides 2 new tools with a new color palette to change sélection color :
  • text color
  • background color

Files

RM_31385_formating_toolbar_color_tools_SVN.diff (4.3 KB) RM_31385_formating_toolbar_color_tools_SVN.diff Jérôme BATAILLE, 2019-05-18 14:49
bt_bgcolor.png (429 Bytes) bt_bgcolor.png Jérôme BATAILLE, 2019-05-18 14:49
bt_color.png (699 Bytes) bt_color.png Jérôme BATAILLE, 2019-05-18 14:49
text_color_and_background.png (8.75 KB) text_color_and_background.png Jérôme BATAILLE, 2019-05-18 15:06
text_color.png (14.8 KB) text_color.png Jérôme BATAILLE, 2019-05-18 15:06
RM_31385_formating_toolbar_color_tools_SVN.diff (6.25 KB) RM_31385_formating_toolbar_color_tools_SVN.diff Jérôme BATAILLE, 2019-05-21 01:33
RM_31385_formating_toolbar_color_tools_SVN.diff (6.81 KB) RM_31385_formating_toolbar_color_tools_SVN.diff Jérôme BATAILLE, 2019-05-21 23:53
RM_31385_formating_toolbar_color_tools2_SVN.diff (8.36 KB) RM_31385_formating_toolbar_color_tools2_SVN.diff Jérôme BATAILLE, 2019-05-24 03:08
RM_31385_formating_toolbar_color_tools_jstoolbar_SVN.diff (4.44 KB) RM_31385_formating_toolbar_color_tools_jstoolbar_SVN.diff Jérôme BATAILLE, 2019-09-16 16:48

Updated by Jérôme BATAILLE over 7 years ago Actions #1

The correct issue title should : Formating toolbar : new color tools

Updated by Go MAEDA over 7 years ago Actions #2

  • Subject changed from Wiki formating tous : new color tools to Formating toolbar : new color tools

Updated by Jérôme BATAILLE over 7 years ago Actions #3

Here is the patch, and the 2 new images to put in public/images/jstoolbar/

This patch does not manage the case when we want background an text color at the same time.

Updated by Jérôme BATAILLE over 7 years ago Actions #5

Here is a new patch managing some mixed cases of color / background color.

Detects if selected text already contains a css tag.
  • If tag contains the css we want, replace the color.
  • If not, add the css to the other tags.

Updated by Jérôme BATAILLE over 7 years ago Actions #6

Fixed previous patch.

Managed more mixed color / background color tags.

@Go thanks to have renamed the issue subject

Updated by Go MAEDA over 7 years ago Actions #7

The patch seems supports only Textile but Markdown. Since Redmine supports both Textile and Markdown, I think the patch should also support Markdown.

Updated by Jérôme BATAILLE over 7 years ago Actions #8

Hi, I am going to provide the patch for <span style color="green">Markdown</span>

Now that Textile is OK.

Updated by Jérôme BATAILLE over 7 years ago Actions #9

Hi, here is a patch to apply after the previous patch.
It includes code refactoring and Markdown support.
For Markdown, html filter must be disabled (C.f. http://www.redmine.org/boards/2/topics/56096?r=57052#message-57052).

One remark about responsive design, the tools icons div has no horizontal scrollbar enabled. Thus some icons on the right can disappear with smaller window size.

Updated by Go MAEDA over 7 years ago Actions #10

  • Target version set to Candidate for next major release

Updated by Jérôme BATAILLE over 7 years ago Actions #11

Thanks Go to have proposed this for the next major release.

Updated by Dmitry Makurin about 7 years ago Actions #12

Two latest patches don't work without:

Index: public/javascripts/jstoolbar/jstoolbar.js
===================================================================
--- public/javascripts/jstoolbar/jstoolbar.js    (date 1568621686000)
+++ public/javascripts/jstoolbar/jstoolbar.js    (date 1568636186385)
@@ -373,12 +373,12 @@
         }

         if (typeof(fn) == 'function') {
-            res = (sel) ? fn.call(this,sel) : fn('');
+            res = (sel) ? fn.call(this,sel,prefix,suffix) : fn('');
         } else {
             res = (sel) ? sel : '';
         }

-        subst = prefix + res + suffix;
+        subst = res;

         if (typeof(document["selection"]) != "undefined") {
             document.selection.createRange().text = subst;

Am I missing something? That change have never been mentioned in any of related patches.

Updated by Jérôme BATAILLE about 7 years ago Actions #13

Hello, you're right changes to jstoolbar.js were missing.

Here is the full SVN diff for this file.

Actions

Also available in: PDF Atom