Changes for page Main

Last modified by Administrator on 2023/03/27 10:53

From version 6.1
edited by Administrator
on 2022/12/28 19:36
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/14.10.2]
To version 4.1
edited by Administrator
on 2020/04/11 15:02
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/11.10.4]

Summary

Details

Page properties
Content
... ... @@ -97,7 +97,6 @@
97 97   #set ($fieldURL = $doc.getURL('edit', $escapetool.url({
98 98   'xpage': 'plain',
99 99   'sheet': 'AppWithinMinutes.ClassEditSheet',
100 - 'template': 'AppWithinMinutes.ClassTemplate',
101 101   'field': $formFieldDoc.fullName,
102 102   'xeditmode': 'text'
103 103   })))
... ... @@ -388,6 +388,7 @@
388 388   * Display the edit class form.
389 389   *#
390 390  #macro (displayEditForm)
390 + #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'))
... ... @@ -617,10 +617,6 @@
617 617   #set($discard = $sheetDoc.setParent($doc.documentReference.name))
618 618   #set($discard = $sheetDoc.setContent($doc.getRenderedContent($sheetGeneratorDoc.content,
619 619   $sheetGeneratorDoc.syntax.toIdString(), 'plain/1.0')))
620 - ## We assume for now that the output produced by the sheet generator uses the same syntax as the code of the sheet
621 - ## generator. We have to set the syntax because the default wiki syntax (used when creating new wiki pages) could
622 - ## be different than the one used by the sheet generator.
623 - #set($discard = $sheetDoc.setSyntax($sheetGeneratorDoc.syntax))
624 624   #set($discard = $sheetDoc.setHidden(true))
625 625   #set($discard = $sheetDoc.save($services.localization.render('platform.appwithinminutes.classEditorSheetSaveComment'),
626 626   $minorEdit))
... ... @@ -646,7 +646,6 @@
646 646   #set($translationsGeneratorDoc = $xwiki.getDocument('AppWithinMinutes.ClassTranslationsGenerator'))
647 647   #set($discard = $translationsDoc.setContent($doc.getRenderedContent($translationsGeneratorDoc.content,
648 648   $translationsGeneratorDoc.syntax.toIdString(), 'plain/1.0')))
649 - #set($discard = $translationsDoc.setSyntaxId('plain/1.0'))
650 650   #set($discard = $translationsDoc.setHidden(true))
651 651   #set($discard = $translationsDoc.save(
652 652   $services.localization.render('platform.appwithinminutes.classEditorTranslationsSaveComment'),
XWiki.JavaScriptExtension[2]
Code
... ... @@ -515,7 +515,11 @@
515 515  }(XWiki || {}));
516 516  
517 517  (function() {
518 - function initForm(form) {
518 + function init() {
519 + var form = $('inline');
520 + if (!form) {
521 + return false;
522 + }
519 519   // Let the sheet handle the form submit. The form is submitted by default to the preview action which dispatches the
520 520   // request to the save action if the save button is detected on the request parameters. By submitting to the edit
521 521   // action the edit sheet is evaluated and thus it can handle the save by itself.
... ... @@ -553,18 +553,9 @@
553 553   // Make the palette and the canvas live.
554 554   new XWiki.FormFieldPalette('palette');
555 555   new XWiki.FormCanvas('canvas');
556 - }
557 557  
558 - function init() {
559 - var form = $('inline');
560 - if (form) {
561 - require(['scriptaculous/dragdrop'], function() {
562 - initForm(form);
563 - });
564 - }
565 - return form;
561 + return true;
566 566   }
567 -
568 568   (XWiki.domIsLoaded && init()) || document.observe('xwiki:dom:loaded', init);
569 569  }).call();
570 570