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 2.1
modifié par Admin
sur 15/03/2024 - 13:08
Commentaire de modification : Install extension [com.xwiki.diagram:application-diagram/1.20.1]
À la version 5.1
modifié par Admin
sur 24/06/2024 - 15:24
Commentaire de modification : Install extension [com.xwiki.diagram:application-diagram/1.20.4]

Résumé

Détails

XWiki.JavaScriptExtension[1]
Code
... ... @@ -32,16 +32,17 @@
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 + }
35 35   },
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];
45 45   this.changeListener = mxUtils.bind(this, function(sender, eventObject) {
46 46   this.setModified(true);
47 47   });
XWiki.JavaScriptExtension[2]
Code
... ... @@ -904,13 +904,6 @@
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 - //
914 914   // Change the service name in order to disable notifications.
915 915   //
916 916   EditorUi.prototype.getServiceName = function()