[TASK] Unify clearable input fields 82/34782/4
authorBenjamin Mack <benni@typo3.org>
Sat, 29 Nov 2014 21:51:28 +0000 (22:51 +0100)
committerBenjamin Mack <benni@typo3.org>
Sun, 30 Nov 2014 00:19:18 +0000 (01:19 +0100)
commit7cab5d2d330eb2aeb098f7fd710ec1b56c36ee5e
treec22d79b360c1ed53ce314ceaf9be7aa4b1573add
parentfe83f51c167660d4ae60226139850c9259e7e20e
[TASK] Unify clearable input fields

There are three places in the core
where clearables (cleaning the content
of a input field with an X at the end)
are used.

- FormEngine
- Documentation
- Extension Manager

For EXT:documentation a hand-written
jQuery plugin was added called
"jquery.clearable". This was also used in
Extension Manager. For FormEngine
there was a inline JS code changing
CSS classes on hover.

In recent changes the clearable logic
for FormEngine broke. The proposed
change now unifies the code.

1. The clearable plugin was solved
so it is not called multiple times
on the same input field, and also
takes into account if the input
field is used like in FormEngine
where "hidden" fields are used.

2. The FormEngine RequireJS module
is now cleaned so it has a method
"TYPO3.FormEngine.reinitialize" which
can be used from outside the module
for AJAX requests like IRRE.

3. The FormEngine now uses the clearable
plugin initialized via the new function
instead of its own inlineJS logic,
and removes the old broken logic.

4. The corresponding CSS is now included
in the LESS file instead of a separate file
with a few lines.

Resolves: #63432
Releases: master
Change-Id: I0f7d4acb9b31ae32ae766c1f56dbdeb0ea3f24e6
Reviewed-on: http://review.typo3.org/34782
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
typo3/contrib/jquery/jquery.clearable.css [deleted file]
typo3/contrib/jquery/jquery.clearable.js
typo3/sysext/backend/Classes/Form/Element/InputElement.php
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js
typo3/sysext/documentation/Resources/Private/Layouts/Default.html
typo3/sysext/extensionmanager/Resources/Private/Layouts/Main.html
typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less
typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_main_form.less
typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css