From 4baa1f28b3ed4159df49845866410c7f389cbe2b Mon Sep 17 00:00:00 2001
From: Carsten  Rose <carsten.rose@math.uzh.ch>
Date: Thu, 16 Mar 2017 19:44:04 +0100
Subject: [PATCH] BuildFormBootstrap.php: wrapping of optional
 'submitButtonText' now done with the configured form wrap setup
 qfq-bs.css.less: dislay characterCount inside of input/textarea element.

---
 extension/qfq/qfq/AbstractBuildForm.php  | 3 ++-
 extension/qfq/qfq/BuildFormBootstrap.php | 6 +++++-
 extension/qfq/qfq/Constants.php          | 3 +++
 less/qfq-bs.css.less                     | 9 ++++++---
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/extension/qfq/qfq/AbstractBuildForm.php b/extension/qfq/qfq/AbstractBuildForm.php
index cca8fb653..a3c72f4a9 100644
--- a/extension/qfq/qfq/AbstractBuildForm.php
+++ b/extension/qfq/qfq/AbstractBuildForm.php
@@ -2715,7 +2715,8 @@ abstract class AbstractBuildForm {
      * @return mixed
      */
     public function buildNote(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
-        return Support::wrapTag("<div class='qfq-note'>", $value);
+//
+        return Support::wrapTag("<div class='" . CLASS_NOTE . "'>", $value);
     }
 
     /**
diff --git a/extension/qfq/qfq/BuildFormBootstrap.php b/extension/qfq/qfq/BuildFormBootstrap.php
index 1d51d8e12..8dcfecbe9 100644
--- a/extension/qfq/qfq/BuildFormBootstrap.php
+++ b/extension/qfq/qfq/BuildFormBootstrap.php
@@ -329,6 +329,11 @@ class BuildFormBootstrap extends AbstractBuildForm {
 
         // Button Save at bottom of form - only if there is a button text given.
         if ($this->formSpec[F_SUBMIT_BUTTON_TEXT] !== '') {
+
+
+            // Default setzen:
+            $this->fillWrapLabelInputNote($this->formSpec[F_BS_LABEL_COLUMNS], $this->formSpec[F_BS_INPUT_COLUMNS], $this->formSpec[F_BS_NOTE_COLUMNS]);
+
             $buttonText = $this->formSpec[F_SUBMIT_BUTTON_TEXT];
 
             $htmlElement = $this->buildButtonCode('save-button', $buttonText, '', '', $this->formSpec[F_BUTTON_ON_CHANGE_CLASS]);
@@ -429,7 +434,6 @@ EOF;
             [$this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_START], $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_END]], $formElement[FE_HTML_ID] . HTML_ID_EXTENSION_INPUT);
 
         // Note
-//        $note = Support::wrapTag("<div class='qfq-note'>", $formElement[FE_NOTE], true);
         $note = $formElement[FE_NOTE];
         $html .= $this->customWrap($formElement, $note, FE_WRAP_NOTE, $formElement[FE_BS_NOTE_COLUMNS],
             [$this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_START], $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_END]], $formElement[FE_HTML_ID] . HTML_ID_EXTENSION_NOTE);
diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php
index e0fcc2bb8..80d4f02c0 100644
--- a/extension/qfq/qfq/Constants.php
+++ b/extension/qfq/qfq/Constants.php
@@ -460,6 +460,9 @@ const DATA_REQUIRED = 'data-required';
 
 const CLASS_TYPEAHEAD = 'qfq-typeahead';
 const DATA_TYPEAHEAD_SIP = 'data-typeahead-sip'; // Used for typeAhead
+
+const CLASS_NOTE = 'qfq-note';
+
 //const CLASS_TYPEAHEAD = 'qfq-type-ahead';
 //const DATA_TYPEAHEAD_SIP = 'data-sip'; // Used for typeAhead
 
diff --git a/less/qfq-bs.css.less b/less/qfq-bs.css.less
index b041691d3..24c6205bd 100644
--- a/less/qfq-bs.css.less
+++ b/less/qfq-bs.css.less
@@ -136,9 +136,12 @@ i.@{spinner_class} {
 
 .qfq-cc-style {
   font-size: 0.8em;
-  text-color: #ededed;
-  padding-left: 14px;
-  padding-top: 2px;
+  color: #777;
+  position: relative;
+  top: -24px;
+  right: 10px;
+  text-align: right;
+  display: block;
 }
 
 // TypeAhead Suggestions
-- 
GitLab