21require
'../../../../main.inc.php';
31if ($user->socid > 0) {
36require_once DOL_DOCUMENT_ROOT .
'/admin/tools/ui/class/documentation.class.php';
39$langs->load(
'uxdocumentation');
43$group =
'ExperimentalUx';
44$experimentName =
'ExperimentalUxInputAjaxFeedback';
46$experimentAssetsPath = $documentation->baseUrl .
'/experimental/experiments/input-feedback/assets/';
48 '/includes/ace/src/ace.js',
49 '/includes/ace/src/ext-statusbar.js',
50 '/includes/ace/src/ext-language_tools.js',
57$documentation->docHeader($langs->trans($experimentName, $group), $js, $css);
60$documentation->view = [$group, $experimentName];
63$documentation->showSidebar(); ?>
65<div
class=
"doc-wrapper">
67 <?php $documentation->showBreadCrumb(); ?>
69 <div
class=
"doc-content-wrapper">
71 <h1
class=
"documentation-title"><?php echo $langs->trans($experimentName); ?></h1>
73 <?php $documentation->showSummary(); ?>
75 <div
class=
"documentation-section" >
76 <h2
class=
"documentation-title" >Input Feedback</h2>
79 This feature provides visual feedback on input fields based on their processing state.
84 <li><strong>Processing:</strong> The <code>.processing-feedback</code>
class is applied
while an action is being processed.</li>
85 <li><strong>Success:</strong> Once successfully completed, the <code>.success-feedback</code> class is applied.</li>
86 <li><strong>Failure:</strong> In case of an error, the <code>.fail-feedback</code> class is applied.</li>
91 <div class="documentation-example">
92 <input type="text" id="test-input-01" placeholder="Type something..." />
93 <button id="btn-process-fail" type="button" class="button" >Processing will fail</button>
94 <button id="btn-process-success" type="button" class="button" >Processing will success</button>
96 document.getElementById('btn-process-success').addEventListener('click', function () {
97 let input = document.getElementById('test-input-01');
98 input.classList.add('processing-feedback');
101 input.classList.remove('processing-feedback');
102 input.classList.add('success-feedback');
104 input.classList.remove('success-feedback');
110 document.getElementById('btn-process-fail').addEventListener('click', function () {
111 let input = document.getElementById('test-input-01');
112 input.classList.add('processing-feedback');
115 input.classList.remove('processing-feedback');
116 input.classList.add('fail-feedback');
118 input.classList.remove('fail-feedback');
127 'document.getElementById(\'btn-process-success\').addEventListener(\'click\', function () {
128 let input = document.getElementById(\'test-input-01\');
129 input.classList.add(\'processing-feedback\');
132 input.classList.remove(\'processing-feedback\');
133 input.classList.add(\'success-feedback\');
135 input.classList.remove(\'success-feedback\');
141document.getElementById(\'btn-process-fail\').addEventListener(\'click\', function () {
142 let input = document.getElementById(\'test-input-01\');
143 input.classList.add(\'processing-feedback\');
146 input.classList.remove(\'processing-feedback\');
147 input.classList.add(\'fail-feedback\');
149 input.classList.remove(\'fail-feedback\');
155 $documentation->showCode($lines); ?>
164$documentation->docFooter();
while( $i< $imaxinloop)
The main.inc.php has been included so the following variable are now defined:
Class to manage UI documentation.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.