From ae43a27dd25dd7f751c095690e604a674028e3ee Mon Sep 17 00:00:00 2001
From: Paulo Gustavo Veiga
Date: Mon, 20 Feb 2012 11:32:37 -0300
Subject: [PATCH] All the resources of the editor asume that the resources
css,js and images are relative to /. The base parameter could be used to
change the default location.
---
mindplot/src/main/javascript/ImageIcon.js | 2 +-
mindplot/src/main/javascript/LinkIcon.js | 2 +-
.../main/javascript/LocalStorageManager.js | 2 +-
mindplot/src/main/javascript/NoteIcon.js | 2 +-
.../javascript/widget/ColorPalettePanel.js | 2 +-
mindplot/src/main/javascript/widget/Menu.js | 12 +--
.../main/javascript/widget/TopicShapePanel.js | 8 +-
.../src/main/webapp/{html => c}/collab.html | 0
wise-editor/src/main/webapp/css/editor.less | 2 +-
.../src/main/webapp/html/container.html | 4 +-
wise-editor/src/main/webapp/html/editor.html | 60 +++++++-------
.../src/main/webapp/html/embedded.html | 57 +++++++-------
.../src/main/webapp/html/viewmode.html | 17 ++--
wise-editor/src/main/webapp/js/editor.js | 10 +--
.../webapp/WEB-INF/wisemapping-servlet.xml | 2 +-
wise-webapp/src/main/webapp/js/help.js | 78 -------------------
.../src/main/webapp/jsp/mindmapEditor.jsp | 29 +++----
17 files changed, 102 insertions(+), 187 deletions(-)
rename wise-editor/src/main/webapp/{html => c}/collab.html (100%)
delete mode 100644 wise-webapp/src/main/webapp/js/help.js
diff --git a/mindplot/src/main/javascript/ImageIcon.js b/mindplot/src/main/javascript/ImageIcon.js
index 61ab5d15..6f44ed4b 100644
--- a/mindplot/src/main/javascript/ImageIcon.js
+++ b/mindplot/src/main/javascript/ImageIcon.js
@@ -53,7 +53,7 @@ mindplot.ImageIcon = new Class({
},
_getImageUrl : function(iconId) {
- return "../icons/" + iconId + ".png";
+ return "icons/" + iconId + ".png";
},
getModel : function() {
diff --git a/mindplot/src/main/javascript/LinkIcon.js b/mindplot/src/main/javascript/LinkIcon.js
index 52b4c562..be4a176e 100644
--- a/mindplot/src/main/javascript/LinkIcon.js
+++ b/mindplot/src/main/javascript/LinkIcon.js
@@ -52,6 +52,6 @@ mindplot.LinkIcon = new Class({
actionDispatcher.removeLinkFromTopic(this._topic.getId());
}
});
-mindplot.LinkIcon.IMAGE_URL = "../images/links.png";
+mindplot.LinkIcon.IMAGE_URL = "images/links.png";
\ No newline at end of file
diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js
index d4306e2a..f6f77ceb 100644
--- a/mindplot/src/main/javascript/LocalStorageManager.js
+++ b/mindplot/src/main/javascript/LocalStorageManager.js
@@ -32,7 +32,7 @@ mindplot.LocalStorageManager = new Class({
if (xml == null) {
// Let's try to open one from the local directory ...
var xmlRequest = new Request({
- url: '../samples/' + mapId + '.xml',
+ url: 'samples/' + mapId + '.xml',
method: 'get',
async: false,
onSuccess: function(responseText) {
diff --git a/mindplot/src/main/javascript/NoteIcon.js b/mindplot/src/main/javascript/NoteIcon.js
index 17f5e73b..261c4159 100644
--- a/mindplot/src/main/javascript/NoteIcon.js
+++ b/mindplot/src/main/javascript/NoteIcon.js
@@ -83,5 +83,5 @@ mindplot.NoteIcon = new Class({
}
});
-mindplot.NoteIcon.IMAGE_URL = "../images/notes.png";
+mindplot.NoteIcon.IMAGE_URL = "images/notes.png";
diff --git a/mindplot/src/main/javascript/widget/ColorPalettePanel.js b/mindplot/src/main/javascript/widget/ColorPalettePanel.js
index f68aa2d0..0765c688 100644
--- a/mindplot/src/main/javascript/widget/ColorPalettePanel.js
+++ b/mindplot/src/main/javascript/widget/ColorPalettePanel.js
@@ -22,7 +22,7 @@ mindplot.widget.ColorPalettePanel = new Class({
initialize : function(buttonId, model, baseUrl) {
this._baseUrl = baseUrl;
this.parent(buttonId, model);
- $assert(baseUrl, "baseUrl can not be null");
+ $assert($defined(baseUrl), "baseUrl can not be null");
},
_load : function() {
diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js
index 74ba58de..8b9b527d 100644
--- a/mindplot/src/main/javascript/widget/Menu.js
+++ b/mindplot/src/main/javascript/widget/Menu.js
@@ -22,7 +22,7 @@ mindplot.widget.Menu = new Class({
initialize : function(designer, containerId, mapId, readOnly, baseUrl) {
this.parent(designer, containerId, mapId);
- baseUrl = !$defined(baseUrl) ? "../" : baseUrl;
+ baseUrl = !$defined(baseUrl) ? "" : baseUrl;
var widgetsBaseUrl = baseUrl + "css/widget";
// Stop event propagation ...
@@ -178,7 +178,7 @@ mindplot.widget.Menu = new Class({
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('fontColor', fontColorModel, baseUrl));
this._addButton('export', false, false, function() {
- var reqDialog = new MooDialog.Request('../c/export.htm?mapId=' + mapId, null,
+ var reqDialog = new MooDialog.Request('c/export.htm?mapId=' + mapId, null,
{'class': 'exportModalDialog',
closeButton:true,
destroyOnClose:true,
@@ -280,7 +280,7 @@ mindplot.widget.Menu = new Class({
var tagElem = $('tagIt');
if (tagElem) {
this._addButton('tagIt', false, false, function() {
- var reqDialog = new MooDialog.Request('../c/tags.htm?mapId=' + mapId, null,
+ var reqDialog = new MooDialog.Request('c/tags.htm?mapId=' + mapId, null,
{'class': 'tagItModalDialog',
closeButton:true,
destroyOnClose:true,
@@ -297,7 +297,7 @@ mindplot.widget.Menu = new Class({
var shareElem = $('shareIt');
if (shareElem) {
this._addButton('shareIt', false, false, function() {
- var reqDialog = new MooDialog.Request('../c/mymaps.htm?action=collaborator&userEmail=paulo%40pveiga.com.ar&mapId=' + mapId, null,
+ var reqDialog = new MooDialog.Request('c/mymaps.htm?action=collaborator&mapId=' + mapId, null,
{'class': 'shareItModalDialog',
closeButton:true,
destroyOnClose:true,
@@ -315,7 +315,7 @@ 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,
+ var reqDialog = new MooDialog.Request('c/publish.htm?mapId=' + mapId, null,
{'class': 'publishModalDialog',
closeButton:true,
destroyOnClose:true,
@@ -334,7 +334,7 @@ mindplot.widget.Menu = new Class({
if (historyElem) {
this._addButton('history', false, false, function() {
- var reqDialog = new MooDialog.Request('../c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null,
+ var reqDialog = new MooDialog.Request('c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null,
{'class': 'historyModalDialog',
closeButton:true,
destroyOnClose:true,
diff --git a/mindplot/src/main/javascript/widget/TopicShapePanel.js b/mindplot/src/main/javascript/widget/TopicShapePanel.js
index 572163d3..70fa5394 100644
--- a/mindplot/src/main/javascript/widget/TopicShapePanel.js
+++ b/mindplot/src/main/javascript/widget/TopicShapePanel.js
@@ -26,10 +26,10 @@ mindplot.widget.TopicShapePanel = new Class({
var content = new Element("div", {'class':'toolbarPanel','id':'topicShapePanel'});
content.innerHTML = '' +
- '' +
- '' +
- '' +
- '';
+ '' +
+ '' +
+ '' +
+ '';
return content;
diff --git a/wise-editor/src/main/webapp/html/collab.html b/wise-editor/src/main/webapp/c/collab.html
similarity index 100%
rename from wise-editor/src/main/webapp/html/collab.html
rename to wise-editor/src/main/webapp/c/collab.html
diff --git a/wise-editor/src/main/webapp/css/editor.less b/wise-editor/src/main/webapp/css/editor.less
index 5cff02f5..4abd09b9 100644
--- a/wise-editor/src/main/webapp/css/editor.less
+++ b/wise-editor/src/main/webapp/css/editor.less
@@ -1,5 +1,5 @@
@import "compatibility.less";
-@import "../css/libraries/moodialog/css/MooDialog.css";
+@import "css/libraries/moodialog/css/MooDialog.css";
/********************************************************************************/
/* Header & Toolbar Styles */
diff --git a/wise-editor/src/main/webapp/html/container.html b/wise-editor/src/main/webapp/html/container.html
index b18f1fef..2e3e3e12 100644
--- a/wise-editor/src/main/webapp/html/container.html
+++ b/wise-editor/src/main/webapp/html/container.html
@@ -41,7 +41,7 @@
This is a simple example of how WiseMapping can be embedded in a page.
Embedding WiseMapping editor is such simple as copying this line in your page:
- <iframe src="embedded.html?confUrl=../html/container.json" width="800" height="600"></iframe>
+ <iframe src="embedded.html?confUrl=html/container.json" width="800" height="600"></iframe>
The container.json file contains a set of properties that must be configured. Properties:
@@ -61,7 +61,7 @@
-
+
diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html
index 3c749a42..8982283a 100644
--- a/wise-editor/src/main/webapp/html/editor.html
+++ b/wise-editor/src/main/webapp/html/editor.html
@@ -2,20 +2,22 @@