[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-114-gd0f00c0

Shawn Moore shawn at bestpractical.com
Wed Sep 21 11:12:33 EDT 2016


The branch, 4.4-trunk has been updated
       via  d0f00c0da56475083098f8907f98078ab474524b (commit)
      from  9ea1b16f17a70e0136e704a0d95e7d9021063533 (commit)

Summary of changes:
 etc/RT_Config.pm.in                  | 13 +++++++++++++
 lib/RT/Config.pm                     |  9 +++++++++
 share/html/Elements/JavascriptConfig |  3 ++-
 share/static/js/util.js              |  4 ++++
 4 files changed, 28 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit d0f00c0da56475083098f8907f98078ab474524b
Author: Dustin Collins <strega at bestpractical.com>
Date:   Sun Sep 4 02:36:30 2016 -0400

    Add user preference to disable CKEditor context menu
    
    The custom context menu for CKEditor blocks built in browser context
    menu features such as spellcheck, dictionary and browser extension
    options. Added a user preference that will force use of the system
    right click menu by removing the CKEditor plugins associated with the
    editors custom context menu.
    
    Fixes I#32274

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 4627f22..1d2d436 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1896,6 +1896,19 @@ send HTML email messages from the web interface.
 
 Set($MessageBoxRichText, 1);
 
+=item C<$MessageBoxUseSystemContextMenu>
+
+Should the "rich text" editor use the browser's right-click menu?
+
+The rich text editor's custom menu can block system functionality like spell check,
+dictionary lookup and browser extension options. Enabling this option allows the browser's
+native right click menu to be used; However, enabling this option may also prevent
+pasting rich text from other applications.
+
+=cut
+
+Set($MessageBoxUseSystemContextMenu, 0);
+
 =item C<$MessageBoxRichTextHeight>
 
 Height of rich text JavaScript enabled editing boxes (in pixels)
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index dfb3a61..3407796 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -284,6 +284,15 @@ our %META;
             Description => 'WYSIWYG message composer' # loc
         }
     },
+    MessageBoxUseSystemContextMenu => {
+        Section         => 'Ticket composition', #loc
+        Overridable     => 1,
+        SortOrder       => 5.2,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'WYSIWYG use browser right-click menu', #loc
+        },
+    },
     MessageBoxRichTextHeight => {
         Section => 'Ticket composition',
         Overridable => 1,
diff --git a/share/html/Elements/JavascriptConfig b/share/html/Elements/JavascriptConfig
index 0484957..2f5fa0d 100644
--- a/share/html/Elements/JavascriptConfig
+++ b/share/html/Elements/JavascriptConfig
@@ -48,7 +48,8 @@
 <%init>
 my $Config = {};
 $Config->{$_} = RT->Config->Get( $_, $session{CurrentUser} )
-  for qw(rtname WebPath MessageBoxRichText MessageBoxRichTextHeight);
+  for qw(rtname WebPath MessageBoxRichText MessageBoxRichTextHeight
+         MessageBoxUseSystemContextMenu);
 
 my $CurrentUser = {};
 if ($session{CurrentUser} and $session{CurrentUser}->id) {
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 26f404d..5cd61dd 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -286,6 +286,10 @@ function ReplaceAllTextareas() {
         sAgent.indexOf('android') != -1 )
         return false;
 
+    if (RT.Config.MessageBoxUseSystemContextMenu) {
+        CKEDITOR.config.removePlugins = 'liststyle,tabletools,scayt,menubutton,contextmenu';
+    }
+
     // replace all content and signature message boxes
     var allTextAreas = document.getElementsByTagName("textarea");
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list