Découvrez les nouveautés de cette version : Fonctionnalités, améliorations et évolutions vous attendent ! 👉 Cliquez ici pour en savoir plus

Modifications pour le document DiagramEditSheet

Modifié par Admin le 19/03/2025 - 19:24

Depuis la version 3.1
modifié par Admin
sur 16/04/2024 - 12:17
Commentaire de modification : Install extension [com.xwiki.diagram:application-diagram/1.20.4]
À la version 2.1
modifié par Admin
sur 15/03/2024 - 13:08
Commentaire de modification : Install extension [com.xwiki.diagram:application-diagram/1.20.1]

Résumé

Détails

XWiki.JavaScriptExtension[1]
Code
... ... @@ -32,17 +32,16 @@
32 32   },
33 33   setData: function(data) {
34 34   this.input.val(data);
35 - let pages = this.ui.getPagesForXml(data);
36 - if (pages.length > 0) {
37 - this.ui.pages = this.ui.getPagesForXml(data);
38 - }
39 39   },
36 + // We overwrite the base implementation because we don't want to support files that contain multiple diagrams.
37 + updateFileData: function() {
38 + this.setData(mxUtils.getPrettyXml(this.ui.editor.getGraphXml(true, true)));
39 + },
40 40   open: function() {
41 41   var graphXML = this.getData() || '<mxGraphModel/>';
42 42   var graphNode = mxUtils.parseXml(graphXML).documentElement;
43 43   graphNode.fromStorage = true;
44 44   this.ui.editor.setGraphXml(graphNode);
45 - this.ui.currentPage = this.ui.pages[0];
46 46   this.changeListener = mxUtils.bind(this, function(sender, eventObject) {
47 47   this.setModified(true);
48 48   });
XWiki.JavaScriptExtension[2]
Code
... ... @@ -904,6 +904,13 @@
904 904   };
905 905  
906 906   //
907 + // Disable the tabbed UI (setting urlParams['pages'] to '0' is not enough..)
908 + //
909 + EditorUi.prototype.initPages = function() {
910 + // Do nothing.
911 + };
912 +
913 + //
907 907   // Change the service name in order to disable notifications.
908 908   //
909 909   EditorUi.prototype.getServiceName = function()