[FEATURE] Add placeholder attribute to some textfields in wizard 33/43333/7
authorAndreas Häfner <andreas.haefner@tritum.de>
Tue, 15 Sep 2015 13:17:47 +0000 (15:17 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 16 Sep 2015 12:47:46 +0000 (14:47 +0200)
The form wizard is now able to add a placeholder attribute to the
following elements: TEXTLINE, TEXTAREA, PASSWORD and the preset
"email". TypoScript config is properly read and written.

Resolves: #53406
Releases: master
Change-Id: I65a8cf24f5632cc792fbd2ccf4ea73e501113715
Reviewed-on: http://review.typo3.org/43333
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
12 files changed:
typo3/sysext/core/Documentation/Changelog/master/Feature-53406-AddPlaceholderAttributeToSomeTextfieldsInWizard.rst [new file with mode: 0644]
typo3/sysext/form/Classes/Domain/Model/Element/PasswordElement.php
typo3/sysext/form/Classes/Domain/Model/Element/TextareaElement.php
typo3/sysext/form/Classes/Domain/Model/Json/PasswordJsonElement.php
typo3/sysext/form/Classes/Domain/Model/Json/TextareaJsonElement.php
typo3/sysext/form/Classes/Domain/Model/Json/TextlineJsonElement.php
typo3/sysext/form/Configuration/PageTS/modWizards.ts
typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Basic/Password.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Basic/Textarea.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Basic/Textline.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Attributes.js

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-53406-AddPlaceholderAttributeToSomeTextfieldsInWizard.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-53406-AddPlaceholderAttributeToSomeTextfieldsInWizard.rst
new file mode 100644 (file)
index 0000000..2488404
--- /dev/null
@@ -0,0 +1,10 @@
+========================================================================
+Feature: #53406 - Add placeholder attribute to some textfields in wizard
+========================================================================
+
+Description
+===========
+
+The form wizard is now able to add a placeholder attribute to the
+following elements: TEXTLINE, TEXTAREA, PASSWORD and the preset
+"email". TypoScript config is properly read and written.
\ No newline at end of file
index 1e4d5e8..857e954 100644 (file)
@@ -34,6 +34,7 @@ class PasswordElement extends \TYPO3\CMS\Form\Domain\Model\Element\AbstractEleme
                'lang' => '',
                'maxlength' => '',
                'name' => '',
+               'placeholder' => '',
                'readonly' => '',
                'size' => '',
                'style' => '',
index 649386d..fab99b2 100644 (file)
@@ -33,6 +33,7 @@ class TextareaElement extends \TYPO3\CMS\Form\Domain\Model\Element\AbstractEleme
                'id' => '',
                'lang' => '',
                'name' => '',
+               'placeholder' => '',
                'readonly' => '',
                'rows' => '5',
                'style' => '',
index 291c850..103d20d 100644 (file)
@@ -58,6 +58,7 @@ class PasswordJsonElement extends \TYPO3\CMS\Form\Domain\Model\Json\AbstractJson
                'lang',
                'maxlength',
                'name',
+               'placeholder',
                'readonly',
                'size',
                'style',
index c00da72..bf436a7 100644 (file)
@@ -58,6 +58,7 @@ class TextareaJsonElement extends \TYPO3\CMS\Form\Domain\Model\Json\AbstractJson
                'id',
                'lang',
                'name',
+               'placeholder',
                'readonly',
                'rows',
                'style',
index 68b9338..6ec726d 100644 (file)
@@ -58,6 +58,7 @@ class TextlineJsonElement extends \TYPO3\CMS\Form\Domain\Model\Json\AbstractJson
                'lang',
                'maxlength',
                'name',
+               'placeholder',
                'readonly',
                'size',
                'style',
index cc6a0bd..cc86e52 100644 (file)
@@ -34,7 +34,7 @@ prefix = tx_form
                                        showAccordions = legend, label, attributes, options, validation, filters, various
                                        accordions {
                                                attributes {
-                                                       showProperties = accept, acceptcharset, accesskey, action, alt, checked, class, cols, dir, disabled, enctype, id, label, lang, maxlength, method, multiple, name, readonly, rows, selected, size, src, style, tabindex, title, type, value
+                                                       showProperties = accept, acceptcharset, accesskey, action, alt, checked, class, cols, dir, disabled, enctype, id, label, lang, maxlength, method, multiple, name, placeholder, readonly, rows, selected, size, src, style, tabindex, title, type, value
                                                }
                                                label {
                                                        showProperties = label
@@ -214,7 +214,7 @@ prefix = tx_form
                                showAccordions = label, attributes, validation
                                accordions {
                                        attributes {
-                                               showProperties = name
+                                               showProperties = name, placeholder
                                        }
                                        validation {
                                                showRules = required, equals
@@ -239,7 +239,7 @@ prefix = tx_form
                                showAccordions = label, attributes, validation, filters
                                accordions {
                                        attributes {
-                                               showProperties = name, cols, rows
+                                               showProperties = name, placeholder, cols, rows
                                        }
                                        filtering {
                                                showFilters = alphabetic, alphanumeric, lowercase, regexp, stripnewlines, titlecase, trim, uppercase
@@ -253,7 +253,7 @@ prefix = tx_form
                                showAccordions = label, attributes, validation, filters
                                accordions {
                                        attributes {
-                                               showProperties = name
+                                               showProperties = name, placeholder
                                        }
                                        validation {
                                                showRules = alphabetic, alphanumeric, between, date, digit, email, equals, float, greaterthan, inarray, integer, ip, length, lessthan, regexp, required, uri
index 776c7e7..9d77e37 100644 (file)
                        <trans-unit id="attributes_name">
                                <source>Name</source>
                        </trans-unit>
+                       <trans-unit id="attributes_placeholder">
+                               <source>Placeholder</source>
+                       </trans-unit>
                        <trans-unit id="attributes_readonly">
                                <source>Readonly</source>
                        </trans-unit>
index f3680a1..56fbd5e 100644 (file)
@@ -79,6 +79,7 @@ TYPO3.Form.Wizard.Elements.Basic.Password = Ext.extend(TYPO3.Form.Wizard.Element
                                        lang: '',
                                        maxlength: '',
                                        name: '',
+                                       placeholder: '',
                                        readonly: '',
                                        size: '',
                                        style: '',
@@ -99,4 +100,4 @@ TYPO3.Form.Wizard.Elements.Basic.Password = Ext.extend(TYPO3.Form.Wizard.Element
        }
 });
 
-Ext.reg('typo3-form-wizard-elements-basic-password', TYPO3.Form.Wizard.Elements.Basic.Password);
\ No newline at end of file
+Ext.reg('typo3-form-wizard-elements-basic-password', TYPO3.Form.Wizard.Elements.Basic.Password);
index 10e8c1f..8b3d917 100644 (file)
@@ -78,6 +78,7 @@ TYPO3.Form.Wizard.Elements.Basic.Textarea = Ext.extend(TYPO3.Form.Wizard.Element
                                        id: '',
                                        lang: '',
                                        name: '',
+                                       placeholder: '',
                                        readonly: '',
                                        rows: '5',
                                        style: '',
@@ -97,4 +98,4 @@ TYPO3.Form.Wizard.Elements.Basic.Textarea = Ext.extend(TYPO3.Form.Wizard.Element
        }
 });
 
-Ext.reg('typo3-form-wizard-elements-basic-textarea', TYPO3.Form.Wizard.Elements.Basic.Textarea);
\ No newline at end of file
+Ext.reg('typo3-form-wizard-elements-basic-textarea', TYPO3.Form.Wizard.Elements.Basic.Textarea);
index 610001a..3511b90 100644 (file)
@@ -79,6 +79,7 @@ TYPO3.Form.Wizard.Elements.Basic.Textline = Ext.extend(TYPO3.Form.Wizard.Element
                                        lang: '',
                                        maxlength: '',
                                        name: '',
+                                       placeholder: '',
                                        readonly: '',
                                        size: '',
                                        style: '',
@@ -99,4 +100,4 @@ TYPO3.Form.Wizard.Elements.Basic.Textline = Ext.extend(TYPO3.Form.Wizard.Element
        }
 });
 
-Ext.reg('typo3-form-wizard-elements-basic-textline', TYPO3.Form.Wizard.Elements.Basic.Textline);
\ No newline at end of file
+Ext.reg('typo3-form-wizard-elements-basic-textline', TYPO3.Form.Wizard.Elements.Basic.Textline);
index 160b22b..a3421ff 100644 (file)
@@ -341,6 +341,18 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Attributes = Ext.extend(Ext.FormPa
                                                }
                                        });
                                        break;
+                               case 'placeholder':
+                                       formItems.push({
+                                               fieldLabel: TYPO3.l10n.localize('attributes_placeholder'),
+                                               name: 'placeholder',
+                                               listeners: {
+                                                       'triggerclick': {
+                                                               scope: this,
+                                                               fn: this.storeValue
+                                                       }
+                                               }
+                                       });
+                                       break;
                                case 'readonly':
                                        formItems.push({
                                                xtype: 'checkbox',
@@ -648,4 +660,4 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Attributes = Ext.extend(Ext.FormPa
        }
 });
 
-Ext.reg('typo3-form-wizard-viewport-left-options-forms-attributes', TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Attributes);
\ No newline at end of file
+Ext.reg('typo3-form-wizard-viewport-left-options-forms-attributes', TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Attributes);