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 = '' + - '
Rectangle
' + - '
Rounded Rectangle
' + - '
Line
' + - '
'; + '
Rectangle
' + + '
Rounded Rectangle
' + + '
Line
' + + '
'; 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 @@ + WiseMapping - Editor + - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/html/embedded.html b/wise-editor/src/main/webapp/html/embedded.html index 8143171c..b29e229e 100644 --- a/wise-editor/src/main/webapp/html/embedded.html +++ b/wise-editor/src/main/webapp/html/embedded.html @@ -2,20 +2,21 @@ + WiseMapping - Editor - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/html/viewmode.html b/wise-editor/src/main/webapp/html/viewmode.html index 744eb02b..f1bd225f 100644 --- a/wise-editor/src/main/webapp/html/viewmode.html +++ b/wise-editor/src/main/webapp/html/viewmode.html @@ -2,20 +2,21 @@ + WiseMapping - Editor - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 94f361f3..06e0e677 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -49,7 +49,7 @@ function buildDesigner(options) { // Register toolbar event ... if ($('toolbar')) { - var menu = new mindplot.widget.Menu(designer, 'toolbar'); + var menu = new mindplot.widget.Menu(designer, 'toolbar',""); // If a node has focus, focus can be move to another node using the keys. designer._cleanScreen = function() { @@ -150,7 +150,7 @@ editor.WaitDialog = new Class({ 'text-align':'center', width: '400px' }); - var img = new Element('img', {'src': '../images/ajax-loader.gif'}); + var img = new Element('img', {'src': 'images/ajax-loader.gif'}); img.inject(result); return result; }, @@ -165,11 +165,11 @@ editor.Help = { buildHelp:function(panel) { var container = new Element('div'); container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function() { + var content1 = Help.buildContentIcon('images/black-keyboard.png', 'Keyboard Shortcuts', function() { MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false); panel.hidePanel(); }); - var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function() { + var content2 = Help.buildContentIcon('images/firstSteps.png', 'Editor First Steps', function() { var wOpen; var sOptions; @@ -233,4 +233,4 @@ waitDialog = new editor.WaitDialog(); waitDialog.show(); // Loading libraries ... -Asset.javascript("../js/mindplot-min.js"); +Asset.javascript("js/mindplot-min.js"); 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 8fd5e210..8b6b8860 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -16,7 +16,7 @@ /c/userRegistration.htm /c/captcha.htm /c/publicView.htm - /c/export.htm + /service/* /c/search.htm /c/keyboard.htm /c/renameMap.htm diff --git a/wise-webapp/src/main/webapp/js/help.js b/wise-webapp/src/main/webapp/js/help.js deleted file mode 100644 index e90225bc..00000000 --- a/wise-webapp/src/main/webapp/js/help.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -var Help = { - buildHelp:function(panel){ - var container = new Element('div'); - container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function(){MOOdalBox.open('keyboard.htm','KeyBoard Shortcuts', '500px 400px', false);panel.hidePanel();}); - var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function(){ - var wOpen; - var sOptions; - - sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; - sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); - sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); - sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; - - wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); - wOpen.focus(); - wOpen.moveTo( 0, 0 ); - wOpen.resizeTo( screen.availWidth, screen.availHeight ); - panel.hidePanel(); - }); - - container.addEvent('show', function(){ - content1.effect('opacity',{duration:800}).start(0,100); - var eff = function(){content2.effect('opacity',{duration:800}).start(0,100);}; - eff.delay(150); - }); - container.addEvent('hide', function(){ - content1.effect('opacity').set(0); - content2.effect('opacity').set(0) - }); - content1.inject(container); - content2.inject(container); - return container; - }, - buildContentIcon:function(image, text, onClickFn){ - var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border: '1px solid transparent', cursor:'pointer'}); - - var icon = new Element('div'); - icon.addEvent('click',onClickFn); - var img = new Element('img'); - img.setProperty('src',image); - img.inject(icon); - icon.inject(container); - - var textContainer = new Element('div').setStyles({width:'100%', color:'white'}); - textContainer.innerHTML=text; - textContainer.inject(container); - - container.addEvent('mouseover', function(event){ - $(this).setStyle('border-top', '1px solid #BBB4D6'); - $(this).setStyle('border-bottom', '1px solid #BBB4D6'); - }.bindWithEvent(container)); - container.addEvent('mouseout', function(event){ - $(this).setStyle('border-top', '1px solid transparent'); - $(this).setStyle('border-bottom', '1px solid transparent'); - - }.bindWithEvent(container)); - return container; - } -}; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index b2c05a6e..a7b4a5e1 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -10,19 +10,20 @@ + <spring:message code="SITE.TITLE"/> - ${mindmap.title} - - - - - + + + + + - - + + -
- - - -
-
@@ -91,6 +80,6 @@
- +