From 5d1399017f6c146d9a87ebd09b6ec54c0784ddf7 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 May 2012 18:15:46 -0300 Subject: [PATCH] Add publish map on editor. --- core-js/src/main/javascript/Functions.js | 58 ++++++- core-js/src/main/javascript/Utils.js | 79 +-------- mindplot/src/main/javascript/ControlPoint.js | 4 +- .../main/javascript/LocalStorageManager.js | 4 +- .../src/main/javascript/RelationshipLine.js | 6 +- .../libraries/moodialog/MooDialog.js | 4 +- mindplot/src/main/javascript/util/Shape.js | 51 ++++++ .../main/javascript/widget/LinkIconTooltip.js | 2 +- mindplot/src/main/javascript/widget/Menu.js | 13 +- .../src/main/javascript/widget/NoteEditor.js | 3 +- .../src/test/javascript/ModelMigrationTest.js | 45 ++--- .../javascript/peer/svg/CurvedLinePeer.js | 2 +- wise-editor/doc/ImplementingPersistence.md | 5 +- wise-editor/src/main/webapp/css/editor.less | 161 +++--------------- .../ncontroller/ExtensionsController.java | 4 + .../ncontroller/MindmapController.java | 24 +-- .../ncontroller/PublicPagesController.java | 11 +- .../main/webapp/WEB-INF/defs/definitions.xml | 38 +++-- .../webapp/WEB-INF/wisemapping-servlet.xml | 2 +- .../main/webapp/jsp/dialogFullTemplate.jsp | 23 +++ ...mDialogTemplate.jsp => dialogTemplate.jsp} | 2 +- .../src/main/webapp/jsp/embeddedView.jsp | 4 +- .../src/main/webapp/jsp/iframeWrapper.jsp | 27 +++ .../src/main/webapp/jsp/mindmapEditor.jsp | 4 +- .../src/main/webapp/jsp/mindmapList.jsp | 21 ++- .../src/main/webapp/jsp/mindmapPrint.jsp | 4 +- .../src/main/webapp/jsp/mindmapPublish.jsp | 77 +++++---- 27 files changed, 343 insertions(+), 335 deletions(-) create mode 100644 wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp rename wise-webapp/src/main/webapp/jsp/{formDialogTemplate.jsp => dialogTemplate.jsp} (87%) create mode 100644 wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp diff --git a/core-js/src/main/javascript/Functions.js b/core-js/src/main/javascript/Functions.js index a6057ec6..eae4577e 100644 --- a/core-js/src/main/javascript/Functions.js +++ b/core-js/src/main/javascript/Functions.js @@ -25,4 +25,60 @@ $assert = function(assert, message) { // core.Logger.logError(message + "," + stack); } -}; \ No newline at end of file +}; + +Math.sign = function(value) { + return (value >= 0) ? 1 : -1; +}; + +/* + * DOMParser HTML extension + * 2012-02-02 + * + * By Eli Grey, http://eligrey.com + * Public domain. + * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + */ + +/*! @source https://gist.github.com/1129031 */ +/*global document, DOMParser*/ + +(function(DOMParser) { + "use strict"; + + var DOMParser_proto = DOMParser.prototype , real_parseFromString = DOMParser_proto.parseFromString; + + // Firefox/Opera/IE throw errors on unsupported types + try { + // WebKit returns null on unsupported types + if ((new DOMParser).parseFromString("", "text/html")) { + // text/html parsing is natively supported + return; + } + } catch (ex) { + } + + DOMParser_proto.parseFromString = function(markup, type) { + if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { + var + doc = document.implementation.createHTMLDocument("") + , doc_elt = doc.documentElement + , first_elt + ; + + doc_elt.innerHTML = markup; + first_elt = doc_elt.firstElementChild; + + if (// are we dealing with an entire document or a fragment? + doc_elt.childElementCount === 1 + && first_elt.localName.toLowerCase() === "html" + ) { + doc.replaceChild(first_elt, doc_elt); + } + + return doc; + } else { + return real_parseFromString.apply(this, arguments); + } + }; +}(DOMParser)); \ No newline at end of file diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js index ed986bd0..7a353957 100644 --- a/core-js/src/main/javascript/Utils.js +++ b/core-js/src/main/javascript/Utils.js @@ -20,9 +20,6 @@ core.Utils = { }; -Math.sign = function(value) { - return (value >= 0) ? 1 : -1; -}; core.Utils.innerXML = function(/*Node*/node) { // summary: @@ -51,7 +48,7 @@ core.Utils.createDocument = function() { doc = new ActiveXObject(prefixes[i] + ".XMLDOM"); } catch(e) { /* squelch */ } - ; + if ($defined(doc)) { break; @@ -65,77 +62,3 @@ core.Utils.createDocument = function() { return doc; // DOMDocument }; - -core.Utils.createDocumentFromText = function(/*string*/str, /*string?*/mimetype) { - // summary: - // attempts to create a Document object based on optional mime-type, - // using str as the contents of the document - if (!$defined(mimetype)) { - mimetype = "text/xml"; - } - if ($defined(window.DOMParser)) { - var parser = new DOMParser(); - return parser.parseFromString(str, mimetype); - // DOMDocument - } else if ($defined(window.ActiveXObject)) { - var domDoc = core.Utils.createDocument(); - if ($defined(domDoc)) { - domDoc.async = false; - domDoc.loadXML(str); - return domDoc; - // DOMDocument - } - } - return null; -}; - -core.Utils.calculateRelationShipPointCoordinates = function(topic, controlPoint) { - var size = topic.getSize(); - var position = topic.getPosition(); - var m = (position.y - controlPoint.y) / (position.x - controlPoint.x); - var y,x; - var gap = 5; - if (controlPoint.y > position.y + (size.height / 2)) { - y = position.y + (size.height / 2) + gap; - x = position.x - ((position.y - y) / m); - if (x > position.x + (size.width / 2)) { - x = position.x + (size.width / 2); - } else if (x < position.x - (size.width / 2)) { - x = position.x - (size.width / 2); - } - } else if (controlPoint.y < position.y - (size.height / 2)) { - y = position.y - (size.height / 2) - gap; - x = position.x - ((position.y - y) / m); - if (x > position.x + (size.width / 2)) { - x = position.x + (size.width / 2); - } else if (x < position.x - (size.width / 2)) { - x = position.x - (size.width / 2); - } - } else if (controlPoint.x < (position.x - size.width / 2)) { - x = position.x - (size.width / 2) - gap; - y = position.y - (m * (position.x - x)); - } else { - x = position.x + (size.width / 2) + gap; - y = position.y - (m * (position.x - x)); - } - - return new core.Point(x, y); -}; - -core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos) { - var y = srcPos.y - tarPos.y; - var x = srcPos.x - tarPos.x; - var m = y / x; - var l = Math.sqrt(y * y + x * x) / 3; - var fix = 1; - if (srcPos.x > tarPos.x) { - fix = -1; - } - - var x1 = srcPos.x + Math.sqrt(l * l / (1 + (m * m))) * fix; - var y1 = m * (x1 - srcPos.x) + srcPos.y; - var x2 = tarPos.x + Math.sqrt(l * l / (1 + (m * m))) * fix * -1; - var y2 = m * (x2 - tarPos.x) + tarPos.y; - - return [new core.Point(-srcPos.x + x1, -srcPos.y + y1),new core.Point(-tarPos.x + x2, -tarPos.y + y2)]; -}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/ControlPoint.js b/mindplot/src/main/javascript/ControlPoint.js index 446bcba3..da5634dc 100644 --- a/mindplot/src/main/javascript/ControlPoint.js +++ b/mindplot/src/main/javascript/ControlPoint.js @@ -96,11 +96,11 @@ mindplot.ControlPoint = new Class({ var pos = screen.getWorkspaceMousePosition(event); var topic = null; if (point == 0) { - var cords = core.Utils.calculateRelationShipPointCoordinates(this._line.getSourceTopic(), pos); + var cords = mindplot.util.Shape.calculateRelationShipPointCoordinates(this._line.getSourceTopic(), pos); this._line.setFrom(cords.x, cords.y); this._line.setSrcControlPoint(new core.Point(pos.x - cords.x, pos.y - cords.y)); } else { - var cords = core.Utils.calculateRelationShipPointCoordinates(this._line.getTargetTopic(), pos); + var cords = mindplot.util.Shape.calculateRelationShipPointCoordinates(this._line.getTargetTopic(), pos); this._line.setTo(cords.x, cords.y); this._line.setDestControlPoint(new core.Point(pos.x - cords.x, pos.y - cords.y)); } diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js index 3d0405e9..a24a6d59 100644 --- a/mindplot/src/main/javascript/LocalStorageManager.js +++ b/mindplot/src/main/javascript/LocalStorageManager.js @@ -51,7 +51,9 @@ mindplot.LocalStorageManager = new Class({ } } - return core.Utils.createDocumentFromText(xml); + + var parser = new DOMParser(); + return parser.parseFromString(xml, "text/xml"); } } ); diff --git a/mindplot/src/main/javascript/RelationshipLine.js b/mindplot/src/main/javascript/RelationshipLine.js index 94246292..502dbdd9 100644 --- a/mindplot/src/main/javascript/RelationshipLine.js +++ b/mindplot/src/main/javascript/RelationshipLine.js @@ -60,7 +60,7 @@ mindplot.RelationshipLine = new Class({ this._line2d.setStroke(2); var ctrlPoints = this._line2d.getControlPoints(); if (!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()) { - var defaultPoints = core.Utils.calculateDefaultControlPoints(sourcePosition, targetPosition); + var defaultPoints = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, targetPosition); ctrlPoints[0].x = defaultPoints[0].x; ctrlPoints[0].y = defaultPoints[0].y; ctrlPoints[1].x = defaultPoints[1].x; @@ -73,8 +73,8 @@ mindplot.RelationshipLine = new Class({ var tpoint = new core.Point(); tpoint.x = parseInt(ctrlPoints[1].x) + parseInt(targetPosition.x); tpoint.y = parseInt(ctrlPoints[1].y) + parseInt(targetPosition.y); - sPos = core.Utils.calculateRelationShipPointCoordinates(sourceTopic, spoint); - tPos = core.Utils.calculateRelationShipPointCoordinates(targetTopic, tpoint); + sPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(sourceTopic, spoint); + tPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(targetTopic, tpoint); line2d.setFrom(sPos.x, sPos.y); line2d.setTo(tPos.x, tPos.y); diff --git a/mindplot/src/main/javascript/libraries/moodialog/MooDialog.js b/mindplot/src/main/javascript/libraries/moodialog/MooDialog.js index 075626a8..60e16ad0 100644 --- a/mindplot/src/main/javascript/libraries/moodialog/MooDialog.js +++ b/mindplot/src/main/javascript/libraries/moodialog/MooDialog.js @@ -42,11 +42,10 @@ var MooDialog = new Class({ options = this.options; var wrapper = this.wrapper = new Element('div.' + options['class'].replace(' ', '.')).inject(options.inject); - this.content = new Element('div.content').inject(wrapper); if (options.title){ this.title = new Element('div.title').set('text', options.title).inject(wrapper); - wrapper.addClass('MooDialogTitle'); +// this.title.addClass('MooDialogTitle'); } if (options.closeButton){ @@ -54,6 +53,7 @@ var MooDialog = new Class({ events: {click: this.close.bind(this)} }).inject(wrapper); } + this.content = new Element('div.content').inject(wrapper); /**/// IE 6 scroll diff --git a/mindplot/src/main/javascript/util/Shape.js b/mindplot/src/main/javascript/util/Shape.js index ecb4ac36..a54debff 100644 --- a/mindplot/src/main/javascript/util/Shape.js +++ b/mindplot/src/main/javascript/util/Shape.js @@ -41,6 +41,57 @@ mindplot.util.Shape = } return result; + }, + + calculateRelationShipPointCoordinates : function(topic, controlPoint) { + var size = topic.getSize(); + var position = topic.getPosition(); + var m = (position.y - controlPoint.y) / (position.x - controlPoint.x); + var y,x; + var gap = 5; + if (controlPoint.y > position.y + (size.height / 2)) { + y = position.y + (size.height / 2) + gap; + x = position.x - ((position.y - y) / m); + if (x > position.x + (size.width / 2)) { + x = position.x + (size.width / 2); + } else if (x < position.x - (size.width / 2)) { + x = position.x - (size.width / 2); + } + } else if (controlPoint.y < position.y - (size.height / 2)) { + y = position.y - (size.height / 2) - gap; + x = position.x - ((position.y - y) / m); + if (x > position.x + (size.width / 2)) { + x = position.x + (size.width / 2); + } else if (x < position.x - (size.width / 2)) { + x = position.x - (size.width / 2); + } + } else if (controlPoint.x < (position.x - size.width / 2)) { + x = position.x - (size.width / 2) - gap; + y = position.y - (m * (position.x - x)); + } else { + x = position.x + (size.width / 2) + gap; + y = position.y - (m * (position.x - x)); + } + + return new core.Point(x, y); + }, + + calculateDefaultControlPoints : function(srcPos, tarPos) { + var y = srcPos.y - tarPos.y; + var x = srcPos.x - tarPos.x; + var m = y / x; + var l = Math.sqrt(y * y + x * x) / 3; + var fix = 1; + if (srcPos.x > tarPos.x) { + fix = -1; + } + + var x1 = srcPos.x + Math.sqrt(l * l / (1 + (m * m))) * fix; + var y1 = m * (x1 - srcPos.x) + srcPos.y; + var x2 = tarPos.x + Math.sqrt(l * l / (1 + (m * m))) * fix * -1; + var y2 = m * (x2 - tarPos.x) + tarPos.y; + + return [new core.Point(-srcPos.x + x1, -srcPos.y + y1),new core.Point(-tarPos.x + x2, -tarPos.y + y2)]; } }; diff --git a/mindplot/src/main/javascript/widget/LinkIconTooltip.js b/mindplot/src/main/javascript/widget/LinkIconTooltip.js index b3d5f492..5a774045 100644 --- a/mindplot/src/main/javascript/widget/LinkIconTooltip.js +++ b/mindplot/src/main/javascript/widget/LinkIconTooltip.js @@ -61,7 +61,7 @@ mindplot.widget.LinkIconTooltip = new Class({ var imgContainer = new Element('div'); imgContainer.setStyles({ width: '100%', - textAlign: 'center', + textAlign: 'right', 'padding-bottom':'5px', 'padding-top': '5px' }); diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index 615370dd..12f95c30 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -193,7 +193,7 @@ mindplot.widget.Menu = new Class({ this._addButton('export', false, false, function() { var reqDialog = new MooDialog.Request('c/map/' + mapId + '/export.htm', null, - {'class': 'exportModalDialog', + {'class': 'modalDialog exportModalDialog', closeButton:true, destroyOnClose:true, title:'Export' @@ -317,7 +317,7 @@ mindplot.widget.Menu = new Class({ if (tagElem) { this._addButton('tagIt', false, false, function() { var reqDialog = new MooDialog.Request('c/tags.htm?mapId=' + mapId, null, - {'class': 'tagItModalDialog', + {'class': 'modalDialog tagItModalDialog', closeButton:true, destroyOnClose:true, title:'Tags' @@ -335,7 +335,7 @@ mindplot.widget.Menu = new Class({ if (shareElem) { this._addButton('shareIt', false, false, function() { var reqDialog = new MooDialog.Request('c/mymaps.htm?action=collaborator&mapId=' + mapId, null, - {'class': 'shareItModalDialog', + {'class': 'modalDialog shareItModalDialog', closeButton:true, destroyOnClose:true, title:'Share It' @@ -354,8 +354,8 @@ mindplot.widget.Menu = new Class({ var publishElem = $('publishIt'); if (publishElem) { this._addButton('publishIt', false, false, function() { - var reqDialog = new MooDialog.Request('c/publish.htm?mapId=' + mapId, null, - {'class': 'publishModalDialog', + var reqDialog = new MooDialog.Request('c/iframeWrapper.htm?url=c/maps/' + mapId + "/publishf.htm", null, + {'class': 'modalDialog publishModalDialog', closeButton:true, destroyOnClose:true, title:'Publish' @@ -365,6 +365,7 @@ mindplot.widget.Menu = new Class({ reqDialog.setContent('loading...'); } }); + MooDialog.Request.active = reqDialog; }); this._registerTooltip('publishIt', "Publish"); @@ -375,7 +376,7 @@ mindplot.widget.Menu = new Class({ this._addButton('history', false, false, function() { var reqDialog = new MooDialog.Request('c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null, - {'class': 'historyModalDialog', + {'class': 'modalDialog historyModalDialog', closeButton:true, destroyOnClose:true, title:'History' diff --git a/mindplot/src/main/javascript/widget/NoteEditor.js b/mindplot/src/main/javascript/widget/NoteEditor.js index 222b5f77..1d0c1c89 100644 --- a/mindplot/src/main/javascript/widget/NoteEditor.js +++ b/mindplot/src/main/javascript/widget/NoteEditor.js @@ -93,7 +93,7 @@ mindplot.widget.NoteEditor = new Class({ }.bind(this)); // Add buttons ... - var buttonContainer = new Element('div').setStyles({paddingTop:5, textAlign:'center'}); + var buttonContainer = new Element('div').setStyles({paddingTop:5, textAlign:'right'}); // Create accept button ... var okButton = new Element('input', {type:'submit', value:'Accept','class':'btn-primary'}); @@ -113,7 +113,6 @@ mindplot.widget.NoteEditor = new Class({ buttonContainer.inject(form); } - // Create cancel button ... var cButton = new Element('input', {type:'button', value:'Cancel','class':'btn-secondary'}); cButton.setStyle('margin', '5px'); diff --git a/mindplot/src/test/javascript/ModelMigrationTest.js b/mindplot/src/test/javascript/ModelMigrationTest.js index bb17a6d0..67df836e 100644 --- a/mindplot/src/test/javascript/ModelMigrationTest.js +++ b/mindplot/src/test/javascript/ModelMigrationTest.js @@ -1,10 +1,11 @@ -TestCase("Model Migration Tests",{ - setUp:function(){ +TestCase("Model Migration Tests", { + setUp:function() { mapXml = ''; }, - testModelMigration:function(){ - ids=[]; - var domDocument = core.Utils.createDocumentFromText(mapXml); + testModelMigration:function() { + ids = []; + var parser = new DOMParser(); + var domDocument = parser.parseFromString(xml, "text/xml"); var betaSerializer = new mindplot.persistence.XMLSerializer_Beta(); var betaMap = betaSerializer.loadFromDom(domDocument); @@ -22,31 +23,31 @@ TestCase("Model Migration Tests",{ //Assert same nodes recursively //Since Id can change let's assume the order is the same - for(var i = 0; i - + + + + + + + @@ -32,6 +38,9 @@ + + + @@ -42,7 +51,6 @@ - @@ -87,54 +95,60 @@ - + - + - + - + - + - + - + - + + + + + + + - + @@ -156,7 +170,7 @@ - + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index fb5dc2bf..9f9dc9e0 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -180,7 +180,7 @@ - importMapController + importMapController publicView diff --git a/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp new file mode 100644 index 00000000..6d7de593 --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp @@ -0,0 +1,23 @@ +<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %> +<%@ include file="/jsp/init.jsp" %> + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/wise-webapp/src/main/webapp/jsp/formDialogTemplate.jsp b/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp similarity index 87% rename from wise-webapp/src/main/webapp/jsp/formDialogTemplate.jsp rename to wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp index ac360f30..16bba939 100644 --- a/wise-webapp/src/main/webapp/jsp/formDialogTemplate.jsp +++ b/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp @@ -5,7 +5,7 @@ -
+
\ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/embeddedView.jsp b/wise-webapp/src/main/webapp/jsp/embeddedView.jsp index 1ca9f426..584cf5af 100644 --- a/wise-webapp/src/main/webapp/jsp/embeddedView.jsp +++ b/wise-webapp/src/main/webapp/jsp/embeddedView.jsp @@ -28,7 +28,9 @@ var editorProperties = {zoom:${zoom},saveOnLoad:true,collab:'standalone',readOnly:true}; designer = buildDesigner(editorProperties); - var domDocument = core.Utils.createDocumentFromText(mapXml); + var parser = new DOMParser(); + var domDocument = parser.parseFromString(mapXml, "text/xml"); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument, mapId); diff --git a/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp b/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp new file mode 100644 index 00000000..13672749 --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp @@ -0,0 +1,27 @@ +<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %> +<%@ include file="/jsp/init.jsp" %> + +
+ +
+ + +
+
+ + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 63e8599c..35c35acf 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -48,7 +48,9 @@ var designer = buildDesigner(options); // Load map from XML ... - var domDocument = core.Utils.createDocumentFromText(mapXml); + var parser = new DOMParser(); + var domDocument = parser.parseFromString(mapXml, "text/xml"); + var persistence = mindplot.PersistenceManager.getInstance(); var mindmap = persistence.loadFromDom(mapId, domDocument); designer.loadMap(mindmap); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index b52320c3..799a5b36 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -49,7 +49,7 @@ bUseRendered : false, mDataProp: "title", fnRender : function(obj) { - return '' + obj.aData.title + ''; + return '' + obj.aData.title + ''; } }, { @@ -110,13 +110,13 @@ $("#newBtn").click( function() { $("#new-dialog-modal").dialogForm({ - redirect: "c/map/{header.resourceId}/edit.htm", + redirect: "c/maps/{header.resourceId}/edit.htm", url : "../service/maps" }); }); $("#importBtn").click(function() { - window.open('c/map/import.htm'); + window.open('c/maps/import.htm'); }); $("#duplicateBtn").click(function() { @@ -134,7 +134,7 @@ // Initialize dialog ... $("#duplicate-dialog-modal").dialogForm({ - redirect: "c/map/{header.resourceId}/edit.htm", + redirect: "c/maps/{header.resourceId}/edit.htm", url : "../service/maps/" + mapId }); } @@ -194,14 +194,14 @@ $("#printBtn").click(function() { var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); if (mapIds.length > 0) { - window.open('c/map/' + mapIds[0] + '/print.htm'); + window.open('c/maps/' + mapIds[0] + '/print.htm'); } }); $("#infoBtn").click(function() { var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); if (mapIds.length > 0) { - $('#info-dialog-modal .modal-body').load("c/map/" + mapIds[0] + "/details.htm", function() { + $('#info-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/details.htm", function() { $('#info-dialog-modal').modal(); }); @@ -211,7 +211,7 @@ $("#publishBtn").click(function() { var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); if (mapIds.length > 0) { - $('#publish-dialog-modal .modal-body').load("c/map/" + mapIds[0] + "/publish.htm", + $('#publish-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/publish.htm", function() { $('#publish-dialog-modal .btn-accept').click(function() { $('#publish-dialog-modal #publishForm').submit(); @@ -309,10 +309,12 @@ Duplicate
  • Rename
  • Print
  • -
  • Publish
  • +
  • Publish +
  • Share
  • Tag
  • -
  • History
  • +
  • History +
  • @@ -470,5 +472,6 @@ + diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index 26b856d2..673e4f8e 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -87,7 +87,9 @@ var designer = buildDesigner(options); // Load map from XML ... - var domDocument = core.Utils.createDocumentFromText(mapXml); + var parser = new DOMParser(); + var domDocument = parser.parseFromString(mapXml, "text/xml"); + var persistence = mindplot.PersistenceManager.getInstance(); var mindmap = persistence.loadFromDom(mapId, domDocument); designer.loadMap(mindmap); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPublish.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPublish.jsp index c5b4df6c..fadce6e3 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPublish.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPublish.jsp @@ -1,22 +1,24 @@ <%@ include file="/jsp/init.jsp" %> + - -
    -
    -
    - -
    -
    + +

    Warning

    -
    +