Page MenuHomePhabricator

PageForms + TinyMCE: make "MinimizeOnBlur" configurable
Open, Needs TriagePublic

Description

We are using PageForms together with TinyMCE (for textareas and free text inputs). This works really great but what bothers us is the automatic hiding and showing of the TinyMCE editor controls!

The thing is that first the constant change of the size of the editor window is distracting and annoying and second it doesn't always work - on Firefox the controls get hidden but do not reappear when the field is clicked.

So I would like to propose a change to PageForms that makes this behaviour configurable. This is how I implemented it and how it works for me:

diff --git a/extension.json b/extension.json
index 0629870..8c388dc 100644
--- a/extension.json
+++ b/extension.json
@@ -460,6 +460,7 @@
                ]
        },
        "config": {
+               "PageFormsTinyMCEMinimizeOnBlur": true,
                "PageFormsUseDisplayTitle": true,
                "PageFormsSimpleUpload": false,
                "PageFormsMaxAutocompleteValues": 1000,
diff --git a/includes/forminputs/PF_TextAreaInput.php b/includes/forminputs/PF_TextAreaInput.php
index 4a67809..cb7e42b 100644
--- a/includes/forminputs/PF_TextAreaInput.php
+++ b/includes/forminputs/PF_TextAreaInput.php
@@ -70,7 +70,12 @@ class PFTextAreaInput extends PFFormInput {
                        $this->mEditor = 'tinymce';
                        global $wgTinyMCEEnabled;
                        $wgTinyMCEEnabled = true;
+
                        $newClasses = 'mceMinimizeOnBlur';
+                       global $wgPageFormsTinyMCEMinimizeOnBlur;
+                       if ( $wgPageFormsTinyMCEMinimizeOnBlur == false ) {
+                               $newClasses = '';
+                       }
                        if ( $input_name != 'pf_free_text' && !array_key_exists( 'isSection', $this->mOtherArgs ) ) {
                                $newClasses .= ' mcePartOfTemplate';
                        }

Now if I add

$wgPageFormsTinyMCEMinimizeOnBlur = false;

to my LocalSettings.php the controls of TinyMCE stay visible all the time.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 14 2019, 9:28 AM