Changes for page Main

Last modified by Administrator on 2026/02/17 22:15

From version 9.1
edited by Administrator
on 2026/02/17 22:15
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/17.10.3]
To version 5.1
edited by Administrator
on 2020/12/29 00:17
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/12.10.2]

Summary

Details

Page properties
Content
... ... @@ -66,7 +66,7 @@
66 66   #foreach ($category in $services.query.xwql($categoryListStatement).execute())
67 67   #set ($categoryDoc = $xwiki.getDocument($category))
68 68   <li>
69 - <div class="category">$escapetool.xml($categoryDoc.plainTitle)</div>
69 + <div class="category">$categoryDoc.plainTitle</div>
70 70   #set ($formFieldsForCategoryStatement = "from doc.object($formFieldClassName) as field where field.category = :category order by field.priority")
71 71   #set ($formFieldsForCategoryQuery = $services.query.xwql($formFieldsForCategoryStatement).bindValue('category', $category))
72 72   <ul>
... ... @@ -81,7 +81,7 @@
81 81   #else
82 82   #set ($formFieldIconURL = $formFieldDoc.getAttachmentURL($formFieldIcon))
83 83   #end
84 - #set ($formFieldIconRendered = "<img src='$escapetool.xml($formFieldIconURL)' alt='$escapetool.xml($formFieldDoc.plainTitle)' class='icon' />")
84 + #set ($formFieldIconRendered = "<img src='$formFieldIconURL' alt='$escapetool.xml($formFieldDoc.plainTitle)' class='icon' />")
85 85   #end
86 86   <li class="field">
87 87   $formFieldIconRendered
... ... @@ -97,12 +97,11 @@
97 97   #set ($fieldURL = $doc.getURL('edit', $escapetool.url({
98 98   'xpage': 'plain',
99 99   'sheet': 'AppWithinMinutes.ClassEditSheet',
100 - 'form_token': $services.csrf.getToken(),
101 101   'template': 'AppWithinMinutes.ClassTemplate',
102 102   'field': $formFieldDoc.fullName,
103 103   'xeditmode': 'text'
104 104   })))
105 - <input type="hidden" value="$escapetool.xml($fieldURL)" class="data"/>
104 + <input type="hidden" value="$fieldURL" class="data"/>
106 106   </li>
107 107   #end
108 108   </ul>
... ... @@ -190,7 +190,9 @@
190 190   ["#pageLink($sheetReference)"])
191 191   </span>
192 192   #else
193 - #inlineWarning($services.localization.render('platform.appwithinminutes.classEditorMultipleSheetsWarning'))
192 + <span class="warningmessage">
193 + $services.localization.render('platform.appwithinminutes.classEditorMultipleSheetsWarning')
194 + </span>
194 194   #end
195 195   </dd>
196 196   <dt>
... ... @@ -274,7 +274,6 @@
274 274   * Displays a configuration property of a class field. This macro can also be used to display a property of an object.
275 275   *#
276 276  #macro (displayFieldProperty $property $prefix $field)
277 - ## This 'displayFormType' property only exists for boolean fields.
278 278   #set ($displayFormType = $property.getProperty('displayFormType'))
279 279   #if ($property.classType == 'Boolean' && (!$displayFormType || $displayFormType.value == 'checkbox'))
280 280   <dt>
... ... @@ -388,6 +388,8 @@
388 388   * Display the edit class form.
389 389   *#
390 390  #macro (displayEditForm)
391 + #set ($discard = $xwiki.jsfx.use('js/scriptaculous/effects.js'))
392 + #set ($discard = $xwiki.jsfx.use('js/scriptaculous/dragdrop.js'))
391 391   #set ($discard = $xwiki.jsx.use('AppWithinMinutes.ClassEditSheet'))
392 392   #set ($discard = $xwiki.ssx.use('AppWithinMinutes.ClassEditSheet'))
393 393   #set ($discard = $xwiki.ssx.use('AppWithinMinutes.ClassSheetGenerator'))
... ... @@ -666,7 +666,7 @@
666 666   #updateAndSaveTranslations
667 667   #if ($action == 'save')
668 668   #if ($errorMessage)
669 - #error($errorMessage)
671 + <div class="box errormessage">$errorMessage</div>
670 670   #elseif ("$!request.wizard" == 'true')
671 671   ## Redirect to next wizard step.
672 672   #set ($className = $stringtool.removeEnd($doc.fullName, 'Class'))
... ... @@ -677,7 +677,6 @@
677 677   })
678 678   #if (!$xwiki.exists($templateProviderReference))
679 679   #set ($discard = $queryString.putAll({
680 - 'form_token': $services.csrf.getToken(),
681 681   'template': 'XWiki.TemplateProviderTemplate',
682 682   'parent': $doc.fullName
683 683   }))
XWiki.JavaScriptExtension[2]
Code
... ... @@ -300,10 +300,8 @@
300 300   var label = previousDT.down('label');
301 301   prettyNameInput.title = label.textContent || label.innerText;
302 302   }
303 - prettyNameInput.ariaLabel = '$escapetool.javascript($services.localization.render('platform.appwithinminutes.classEditorFieldPrettyNameToolTip'))';
304 304   // Replace the preview label with the pretty name input.
305 305   var previewLabel = field.getViewer().down('label');
306 - // We unset the for attribute, so that this label will not be set implicitely OR explicitely anymore.
307 307   previewLabel.writeAttribute('for', '');
308 308   previewLabel.removeChild(previewLabel.lastChild);
309 309   previewLabel.insert(prettyNameInput);
... ... @@ -328,12 +328,10 @@
328 328   _enhanceFieldDefaultValue : function(event) {
329 329   var field = event.memo.field;
330 330   var fieldName = field.getName();
331 - // We select the default field input and update it.
332 - field.getViewer().select('dd :input').each(function(input) {
329 + field.getViewer().select('input[type=text]', 'textarea').each(function(input) {
333 333   if (!input.title && input.name.endsWith('_0_' + fieldName)) {
334 334   input.title = '$escapetool.javascript($services.localization.render('platform.appwithinminutes.classEditorFieldDefaultValueToolTip'))';
335 335   }
336 - input.ariaLabel = '$escapetool.javascript($services.localization.render('platform.appwithinminutes.classEditorFieldDefaultValueToolTip'))';
337 337   });
338 338   },
339 339   _onSave : function() {
... ... @@ -368,8 +368,7 @@
368 368   if (hintInput) {
369 369   hintInput.addClassName('xHint');
370 370   if (!hintInput.title) {
371 - hintInput.title = '$escapetool.javascript($services.localization.render('platform.appwithinminutes.classEditorFieldHintToolTip'))';
372 - hintInput.ariaLabel = '$escapetool.javascript($services.localization.render('platform.appwithinminutes.classEditorFieldHintToolTip'))';
367 + hintInput.title = 'Hint';
373 373   }
374 374   // Move the hint input below the pretty name input, in the field viewer.
375 375   var dd = hintInput.up('dd');
... ... @@ -520,7 +520,11 @@
520 520  }(XWiki || {}));
521 521  
522 522  (function() {
523 - function initForm(form) {
518 + function init() {
519 + var form = $('inline');
520 + if (!form) {
521 + return false;
522 + }
524 524   // Let the sheet handle the form submit. The form is submitted by default to the preview action which dispatches the
525 525   // request to the save action if the save button is detected on the request parameters. By submitting to the edit
526 526   // action the edit sheet is evaluated and thus it can handle the save by itself.
... ... @@ -558,18 +558,9 @@
558 558   // Make the palette and the canvas live.
559 559   new XWiki.FormFieldPalette('palette');
560 560   new XWiki.FormCanvas('canvas');
561 - }
562 562  
563 - function init() {
564 - var form = $('inline');
565 - if (form) {
566 - require(['scriptaculous/dragdrop'], function() {
567 - initForm(form);
568 - });
569 - }
570 - return form;
561 + return true;
571 571   }
572 -
573 573   (XWiki.domIsLoaded && init()) || document.observe('xwiki:dom:loaded', init);
574 574  }).call();
575 575