Changes for page Office Importer

From version 2.1
edited by Nazzareno Pompei
on 28/10/2022 08:43
Change comment: Install extension [org.xwiki.platform:xwiki-platform-office-ui/14.9]
To version 1.1
edited by N Pompei
on 08/06/2020 17:32
Change comment: Install extension [org.xwiki.platform:xwiki-platform-office-ui/12.4]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.NazzarenoPompei
1 +XWiki.NPompei
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,6 +1,6 @@
1 1  require(['jquery'], function($) {
2 - $(function() {
3 -
2 + $(document).ready(function() {
3 +
4 4   // Add a validator on the document input
5 5   var documentValidator = new LiveValidation($('#filepath')[0], {
6 6   validMessage: "$services.localization.render('core.validation.valid.message')"
... ... @@ -12,7 +12,7 @@
12 12   return typeof value === 'string' && value.strip().length > 0;
13 13   }
14 14   });
15 -
15 +
16 16   /**
17 17   * Enable/disable the split option depending of the value of the split document checkbox
18 18   */
... ... @@ -21,17 +21,17 @@
21 21   $('#headingLevelsToSplitInputId').prop('disabled', splitOptionsDisabled);
22 22   $('#childPagesNamingMethodInputId').prop('disabled', splitOptionsDisabled);
23 23   }
24 -
24 +
25 25   // Initalize the default state
26 26   maybeDisableSplitOptions();
27 -
27 +
28 28   // Enable/disable the split options when the checkbox's value changes
29 - $('#splitDocumentInputId').on('change', maybeDisableSplitOptions);
30 -
29 + $('#splitDocumentInputId').change(maybeDisableSplitOptions);
30 +
31 31   /**
32 32   * Event sent when the form is submitted
33 33   */
34 - $('#officeImportForm').on('submit', function(event) {
34 + $('#officeImportForm').submit(function(event) {
35 35   // Verify that the target document does not already exist
36 36   var appendContentCheckbox = $('#appendContentInputId');
37 37   if (appendContentCheckbox.length == 0 || appendContentCheckbox.prop('checked')) {
... ... @@ -38,7 +38,7 @@
38 38   // Except if the "append content" checkbox is enabled or if it is not present!
39 39   return true;
40 40   }
41 -
41 +
42 42   // The document exist
43 43   new XWiki.widgets.ConfirmationBox({
44 44   onYes: function() {
... ... @@ -50,10 +50,10 @@
50 50   }, {
51 51   confirmationText: "$escapetool.javascript($services.localization.render('platform.office.importDocumentOverwriteConfirmation'))"
52 52   });
53 -
53 +
54 54   return false;
55 55   });
56 -
56 +
57 57   });
58 58  });
59 59