Mode fixes.

This commit is contained in:
Paulo Veiga 2011-07-24 12:09:05 -03:00
parent 45f214e96d
commit aee814ffa7
11 changed files with 7572 additions and 503 deletions

98
wise-doc/pom.xml Normal file
View File

@ -0,0 +1,98 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>wise-doc</artifactId>
<packaging>war</packaging>
<name>WiseMapping WiseDoc</name>
<url>http://www.wisemapping.org</url>
<parent>
<groupId>org.wisemapping</groupId>
<artifactId>wisemapping</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.wisemapping</groupId>
<artifactId>core-js</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>wisemapping</warName>
<overlays>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>core-js</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
</overlays>
<archiveClasses>true</archiveClasses>
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>*.wsdl</include>
<include>*.xsd</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<!-- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<destDir>${project.build.directory}/generated-sources/jaxws</destDir>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws</sourceDestDir>
<target>2.1</target>
<packageName>com.wisemapping.ws</packageName>
<wsdlDirectory>${basedir}/src/main/resources/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>wiseservices.wsdl</wsdlFile>
</wsdlFiles>
</configuration>
</plugin>
-->
</plugins>
</build>
</project>

View File

@ -13,12 +13,14 @@
<link rel="stylesheet" type="text/css" href="../css/bubble.css"/>
<!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>-->
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/mootools.js'></script>
<script type='text/javascript' src='../js/mootools.js'></script>
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/common.js'></script>
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/windoo.js'></script>
<!--<script type='text/javascript' src='../js/wiseEditorLibrary.js'></script>-->
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/IconPanel.js'></script>
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/mooRainbow.js'></script>
<script type='text/javascript' src='../../../../../core-js/target/classes/core.js'></script>
@ -29,8 +31,7 @@
<body>
<form method="post" id="printForm" name="printForm" action='<c:url value="export.htm"/>' style="height:100%;"
target="${mindmap.title}">
<form method="post" id="printForm" name="printForm" action='' style="height:100%;" target="${mindmap.title}">
<input type="hidden" name="action" value="print">
<input type="hidden" name="mapId" value="${mindmap.id}">
<input type="hidden" name="mapSvg" value="">
@ -40,7 +41,7 @@
<div id="waitingContainer">
<div class="loadingIcon"></div>
<div class="loadingText">
<spring:message code="EDITOR.LOADING"/>
SYMB_EDITOR.LOADING
</div>
</div>
</div>
@ -49,7 +50,7 @@
<div id="errorContainer">
<div class="loadingIcon"></div>
<div class="loadingText">
<spring:message code="EDITOR.ERROR_LOADING"/>
SYMB_EDITOR.ERROR_LOADING
</div>
</div>
</div>
@ -66,10 +67,11 @@
});
var mapId = '${mindmap.id}';
var mapXml = '${mapXml}';
var editorProperties = ${mindmap.properties};
var isTryMode = ${editorTryMode};
var mapId = '1';
var mapXml = '<map name="38298" version="pela"><topic central="true" text="test" id="1"/></map>';
// @Todo: This must be persiste in the map properties ...
var editorProperties = "{zoom:0.85,saveOnLoad:true}";
function printMap() {
document.printForm.mapSvg.value = $("workspaceContainer").innerHTML;
@ -106,70 +108,61 @@
</div>
</div>
<div id="actionsContainer"></div>
<div>
<c:url value="mymaps.htm" var="shareMap">
<c:param name="action" value="collaborator"/>
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
</c:url>
<div id="actionsContainer">
</div>
<div id="toolbar">
<div id="editTab" class="tabContent">
<div id="file" class="buttonContainer" title="FILE">
<div id="file" class="buttonContainer" title="SYMB_ FILE">
<fieldset>
<legend>
FILE>
SYMB_FILE
</legend>
<div id="saveButton" class="button" title="SAVE">
<div id="saveButton" class="button" title="SYMB_ SAVE">
<div class="toolbarLabel">
<p>
SAVE
SYMB_SAVE
</p>
</div>
</div>
<div id="discardButton" class="button" title="CLOSE">
<div id="discardButton" class="button" title="SYMB_ CLOSE">
<div class="toolbarLabel">
<p>
CLOSE
SYMB_CLOSE
</p>
</div>
</div>
<div id="undoEdition" class="button" title="<spring:message code=" UNDO_EDITION
"/>">
<div id="undoEdition" class="button" title="SYMB_ UNDO_EDITION">
<div class="toolbarLabel">
<p>
<spring:message code="UNDO"/>
SYMB_UNDO
</p>
</div>
</div>
<div id="redoEdition" class="button" title="<spring:message code=" REDO_EDITION
"/>">
<div id="redoEdition" class="button" title="SYMB_ REDO_EDITION">
<div class="toolbarLabel">
<p>
<spring:message code="REDO"/>
SYMB_REDO
</p>
</div>
</div>
<div id="print" class="button" title="<spring:message code=" PRINT
"/>" onclick="printMap();">
<div id="print" class="button" title="SYMB_ PRINT" onclick="printMap();">
<div class="toolbarLabel">
<p>
<spring:message code="PRINT"/>
SYMB_PRINT
</p>
</div>
</div>
<div id="export" class="button" title="<spring:message code=" EXPORT
"/>">
<div id="export" class="button" title="SYMB_ EXPORT">
<div class="toolbarLabel">
<p>
<spring:message code="EXPORT"/>
SYMB_EXPORT
</p>
</div>
<a id="exportAnchor" href="export.htm?mapId=${mindmap.id}" rel="moodalbox 600px 400px"
title="<spring:message code=" EXPORT_DETAILS"/>">
title="SYMB_ EXPORT_DETAILS">
</a>
</div>
</fieldset>
@ -177,21 +170,19 @@
<div id="zoom" class="buttonContainer" title="Zoom In">
<fieldset>
<legend>
<spring:message code="ZOOM"/>
SYMB_ZOOM
</legend>
<div id="zoomIn" class="button" title="<spring:message code=" ZOOM_IN
"/>">
<div id="zoomIn" class="button" title="SYMB_ ZOOM_IN">
<div class="toolbarLabel">
<p>
<spring:message code="IN"/>
SYMB_IN
</p>
</div>
</div>
<div id="zoomOut" class="button" title="<spring:message code=" ZOOM_OUT
"/>">
<div id="zoomOut" class="button" title="SYMB_ ZOOM_OUT">
<div class="toolbarLabel">
<p>
<spring:message code="OUT"/>
SYMB_OUT
</p>
</div>
</div>
@ -200,77 +191,68 @@
<div id="node" class="buttonContainer" title="Node Properties">
<fieldset>
<legend>
<spring:message code="TOPIC"/>
SYMB_TOPIC
</legend>
<div id="topicShape" class="button comboButton" title="<spring:message code=" TOPIC_SHAPE
"/>">
<div id="topicShape" class="button comboButton" title="SYMB_ TOPIC_SHAPE">
<div class="toolbarLabel">
<p>
<spring:message code="SHAPE"/>
SYMB_SHAPE
</p>
</div>
</div>
<div id="addTopic" class="button" title="<spring:message code=" TOPIC_ADD
"/>">
<div id="addTopic" class="button" title="SYMB_ TOPIC_ADD">
<div class="toolbarLabel">
<p>
<spring:message code="ADD"/>
SYMB_ADD
</p>
</div>
</div>
<div id="deleteTopic" class="button" title="<spring:message code=" TOPIC_DELETE
"/>">
<div id="deleteTopic" class="button" title="SYMB_ TOPIC_DELETE">
<div class="toolbarLabel">
<p>
<spring:message code="DELETE"/>
SYMB_DELETE
</p>
</div>
</div>
<div id="topicBorder" class="button comboButton" title="<spring:message code=" TOPIC_BORDER_COLOR
"/>">
<div id="topicBorder" class="button comboButton" title="SYMB_ TOPIC_BORDER_COLOR">
<div class="toolbarLabel">
<p>
<spring:message code="BORDER"/>
SYMB_BORDER
</p>
</div>
</div>
<div id="topicColor" class="button comboButton" title="<spring:message code=" TOPIC_BACKGROUND_COLOR
"/>">
<div id="topicColor" class="button comboButton" title="SYMB_ TOPIC_BACKGROUND_COLOR">
<div class="toolbarLabel">
<p>
<spring:message code="COLOR"/>
SYMB_COLOR
</p>
</div>
</div>
<div id="topicIcon" class="button comboButton" title="<spring:message code=" TOPIC_ICON
"/>">
<div id="topicIcon" class="button comboButton" title="SYMB_ TOPIC_ICON">
<div class="toolbarLabel">
<p>
<spring:message code="ICON"/>
SYMB_ICON
</p>
</div>
</div>
<div id="topicNote" class="button comboButton" title="<spring:message code=" TOPIC_NOTE
"/>">
<div id="topicNote" class="button comboButton" title="SYMB_ TOPIC_NOTE">
<div class="toolbarLabel">
<p>
<spring:message code="NOTE"/>
SYMB_NOTE
</p>
</div>
</div>
<div id="topicLink" class="button" title="<spring:message code=" TOPIC_LINK
"/>">
<div id="topicLink" class="button" title="SYMB_ TOPIC_LINK">
<div class="toolbarLabel">
<p>
<spring:message code="LINK"/>
SYMB_LINK
</p>
</div>
</div>
<div id="topicRelation" class="topicRelation button" title="<spring:message code=" TOPIC_RELATIONSHIP
"/>">
<div id="topicRelation" class="topicRelation button" title="SYMB_ TOPIC_RELATIONSHIP">
<div class="relationshiplabel toolbarLabel">
<p>
<spring:message code="TOPIC_RELATIONSHIP"/>
SYMB_TOPIC_RELATIONSHIP
</p>
</div>
</div>
@ -279,150 +261,80 @@
<div id="font" class="buttonContainer" title="Font Properties">
<fieldset>
<legend>
<spring:message code="FONT"/>
SYMB_FONT
</legend>
<div id="fontFamily" class="button comboButton" title="<spring:message code=" FONT_TYPE
"/>">
<div id="fontFamily" class="button comboButton" title="SYMB_ FONT_TYPE">
<div class="toolbarLabel">
<p>
<spring:message code="TYPE"/>
SYMB_TYPE
</p>
</div>
</div>
<div id="fontSize" class="button comboButton" title="<spring:message code=" FONT_SIZE
"/>">
<div id="fontSize" class="button comboButton" title="SYMB_ FONT_SIZE">
<div class="toolbarLabel">
<p>
<spring:message code="SIZE"/>
SYMB_SIZE
</p>
</div>
</div>
<div id="fontBold" class="button" title="<spring:message code=" FONT_BOLD
"/>">
<div id="fontBold" class="button" title="SYMB_ FONT_BOLD">
<div class="toolbarLabel">
<p>
<spring:message code="BOLD"/>
SYMB_BOLD
</p>
</div>
</div>
<div id="fontItalic" class="button" title="<spring:message code=" FONT_ITALIC
"/>">
<div id="fontItalic" class="button" title="SYMB_ FONT_ITALIC">
<div class="toolbarLabel">
<p>
<spring:message code="ITALIC"/>
SYMB_ITALIC
</p>
</div>
</div>
<div id="fontColor" class="button comboButton" title="<spring:message code=" FONT_COLOR
"/>">
<div id="fontColor" class="button comboButton" title="SYMB_ FONT_COLOR">
<div class="toolbarLabel">
<p>
<spring:message code="COLOR"/>
SYMB_COLOR
</p>
</div>
</div>
</fieldset>
</div>
<div id="share" class="buttonContainer" title="Share Properties">
<c:choose>
<c:when test="${editorTryMode==false}">
<fieldset>
<legend>
<spring:message code="COLLABORATION"/>
SYMB_COLLABORATION
</legend>
<a id="tagAnchor" href="tags.htm?mapId=${mindmap.id}" rel="moodalbox 400px 200px wizard"
title="<spring:message code=" TAGS_DETAILS"/>">
<div id="tagIt" class="button" title="<spring:message code=" TAG
"/>">
<div id="tagIt" class="button" title="SYMB_ TAG">
<div class="toolbarLabel">
<p>
<spring:message code="TAG"/>
SYMB_TAG
</p>
</div>
</div>
</a>
<c:choose>
<c:when test="${mindmap.owner==user}">
<a id="shareAnchor" href="<c:out value="${shareMap}"/>&amp;mapId=${mindmap.id}"
rel="moodalbox 780px 530px wizard" title="
<spring:message code="SHARE_DETAILS"/>
">
<div id="shareIt" class="button" title="<spring:message code=" COLLABORATION
"/>">
<div id="shareIt" class="button" title="SYMB_ COLLABORATE">
<div class="toolbarLabel">
<p>
<spring:message code="SHARE"/>
SYMB_SHARE
</p>
</div>
</div>
</a>
<a id="publishAnchor" href="publish.htm?mapId=${mindmap.id}"
rel="moodalbox 600px 400px wizard"
title="<spring:message code=" PUBLISH_MSG"/>">
<div id="publishIt" class="button" title="<spring:message code=" PUBLISH
"/>">
<div id="publishIt" class="button" title="SYMB_ PUBLISH">
<div class="toolbarLabel">
<p>
<spring:message code="PUBLISH"/>
SYMB_PUBLISH
</p>
</div>
</div>
</a>
</c:when>
</c:choose>
<a id="historyAnchor" href="history.htm?action=list&amp;mapId=${mindmap.id}"
rel="moodalbox 600px 400px wizard" title="<spring:message code=" HISTORY_MSG"/>">
<div id="history" class="button" title="<spring:message code=" HISTORY_MSG
"/>">
<div id="history" class="button" title="SYMB_ HISTORY_MSG">
<div class="toolbarLabel">
<p>
<spring:message code="HISTORY"/>
</p>
</div>
</div>
</a>
</fieldset>
</c:when>
<c:otherwise>
<fieldset>
<legend>
<spring:message code="COLLABORATION"/>
</legend>
<div id="tagIt" class="button" title="<spring:message code=" TAG
"/>">
<div class="toolbarLabel">
<p>
<spring:message code="TAG"/>
</p>
</div>
</div>
<div id="shareIt" class="button" title="<spring:message code=" COLLABORATE
"/>">
<div class="toolbarLabel">
<p>
<spring:message code="SHARE"/>
</p>
</div>
</div>
<div id="publishIt" class="button" title="<spring:message code=" PUBLISH
"/>">
<div class="toolbarLabel">
<p>
<spring:message code="PUBLISH"/>
</p>
</div>
</div>
<div id="history" class="button" title="<spring:message code=" HISTORY_MSG
"/>">
<div class="toolbarLabel">
<p>
<spring:message code="HISTORY"/>
SYMB_HISTORY
</p>
</div>
</div>
</fieldset>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
@ -431,7 +343,7 @@
<div id="footerEditor">
<div style="position:absolute; top:0px; width:100%">
<a href="${pageContext.request.contextPath}/c/home.htm">
<a href="home.htm">
<div id="logo"></div>
</a>
@ -448,6 +360,7 @@
<div style="float:left; position:relative; top:50%; margin-top:-8px; margin-left:4px;">Shortcuts</div>
</div>
</div>
<div id="ffoxworkarround" style="display:none;"><input id="ffoxWorkarroundInput" type="text"></div>
<script type="text/javascript" src="../js/editor.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View File

@ -17,19 +17,16 @@
*/
function afterCoreLoading()
{
function afterCoreLoading() {
// Uncomment for debug ...
$import("../js/mindplot.svg.js");
$import("../../../../../mindplot/target/classes/mindplot.svg.js");
// $import("../js/mindplot.svg-min.js");
};
}
;
afterCoreLoading();
/*Extend mootools known keys*/
ExtendedKeys = {
'insert': 45,
@ -96,8 +93,7 @@ Tabs = {
if (div.className.match(/\btabContent\b/i)) {
if (div.id == "_" + contentId)
div.style.display = "block";
else
{
else {
divsToHide.push(div);
}
}
@ -122,8 +118,7 @@ Tabs = {
},
Init: function () {
if (!document.getElementsByTagName)
{
if (!document.getElementsByTagName) {
return;
}
@ -178,18 +173,15 @@ var contentId = window.location.hash || "#Introduction";
var iconPanel = null;
function afterMindpotLibraryLoading()
{
function afterMindpotLibraryLoading() {
buildMindmapDesigner();
if ($('helpButton') != null)
{
if ($('helpButton') != null) {
var helpPanel = new Panel({panelButton:$('helpButton'), backgroundColor:'black'});
helpPanel.setContent(Help.buildHelp(helpPanel));
}
if ($('helpButtonFirstSteps') != null)
{
if ($('helpButtonFirstSteps') != null) {
var firstStepsPanel = $('helpButtonFirstSteps')
firstStepsPanel.addEvent('click', function(event) {
var firstStepWindow = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px");
@ -199,8 +191,7 @@ function afterMindpotLibraryLoading()
});
}
if ($('helpButtonKeyboard') != null)
{
if ($('helpButtonKeyboard') != null) {
var keyboardPanel = $('helpButtonKeyboard')
keyboardPanel.addEvent('click', function(event) {
MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false)
@ -229,19 +220,15 @@ function afterMindpotLibraryLoading()
designer.redo();
});
designer.addEventListener("change", function(event) {
if (event.undoSteps > 0)
{
if (event.undoSteps > 0) {
$("undoEdition").setStyle("background-image", "url(../images/file_undo.png)");
} else
{
} else {
$("undoEdition").setStyle("background-image", "url(../images/file_undo_dis.png)");
}
if (event.redoSteps > 0)
{
if (event.redoSteps > 0) {
$("redoEdition").setStyle("background-image", "url(../images/file_redo.png)");
} else
{
} else {
$("redoEdition").setStyle("background-image", "url(../images/file_redo_dis.png)");
}
@ -328,101 +315,31 @@ function afterMindpotLibraryLoading()
var saveButton = $('saveButton');
saveButton.addEvent('click', function(event) {
if (!isTryMode)
{
saveButton.setStyle('cursor', 'wait');
var saveFunc = function()
{
designer.save(function()
{
var saveFunc = function() {
designer.save(function() {
var monitor = core.Monitor.getInstance();
monitor.logMessage('Save completed successfully');
saveButton.setStyle('cursor', 'pointer');
}, true);
}
saveFunc.delay(1);
} else
{
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.<br/> to create an account click <a href="userRegistration.htm">here</a>',
{
'window': {theme:Windoo.Themes.wise,
title:''
}
});
}
});
var discardButton = $('discardButton');
discardButton.addEvent('click', function(event) {
if (!isTryMode)
{
displayLoading();
window.document.location = "mymaps.htm";
} else
{
displayLoading();
window.document.location = "home.htm";
}
});
if (isTryMode)
{
$('tagIt').addEvent('click', function(event)
{
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
{
'window': {theme:Windoo.Themes.wise,
title:''
}
});
});
$('shareIt').addEvent('click', function(event)
{
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
{
'window': {theme:Windoo.Themes.wise,
title:''
}
});
});
$('publishIt').addEvent('click', function(event)
{
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
{
'window': {theme:Windoo.Themes.wise,
title:''
}
});
});
$('history').addEvent('click', function(event)
{
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
{
'window': {theme:Windoo.Themes.wise,
title:''
}
});
});
}
// Autosave ...
if (!isTryMode)
{
var autosave = function() {
if (designer.needsSave())
{
designer.save(function()
{
if (designer.needsSave()) {
designer.save(function() {
var monitor = core.Monitor.getInstance();
}, false);
}
@ -430,14 +347,12 @@ function afterMindpotLibraryLoading()
autosave.periodical(30000);
// To prevent the user from leaving the page with changes ...
window.onbeforeunload = function confirmExit()
{
if (designer.needsSave())
{
window.onbeforeunload = function confirmExit() {
if (designer.needsSave()) {
designer.save(null, false)
}
}
}
// Build panels ...
fontFamilyPanel();
shapeTypePanel();
@ -446,8 +361,7 @@ function afterMindpotLibraryLoading()
// If not problem has occured, I close the dialod ...
var closeDialog = function() {
if(!window.hasUnexpectedErrors)
{
if (!window.hasUnexpectedErrors) {
waitDialog.deactivate();
}
}.delay(500);
@ -456,15 +370,12 @@ function afterMindpotLibraryLoading()
function buildIconChooser() {
var content = new Element('div').setStyles({width:253,height:200,padding:5});
var count = 0;
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1)
{
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1) {
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i].icons;
for (var j = 0; j < familyIcons.length; j = j + 1)
{
for (var j = 0; j < familyIcons.length; j = j + 1) {
// Separate icons by line ...
var familyContent;
if ((count % 12) == 0)
{
if ((count % 12) == 0) {
familyContent = new Element('div').inject(content);
}
@ -486,22 +397,19 @@ function buildIconChooser() {
;
function setCurrentColorPicker(colorPicker)
{
function setCurrentColorPicker(colorPicker) {
this.currentColorPicker = colorPicker;
}
function removeCurrentColorPicker(colorPicker)
{
function removeCurrentColorPicker(colorPicker) {
$clear(this.currentColorPicker);
}
function buildMindmapDesigner()
{
function buildMindmapDesigner() {
// Initialize message logger ...
var monitor = new core.Monitor($('msgLoggerContainer'), $('msgLogger'));
core.Monitor.setInstance(monitor);
// var monitor = new core.Monitor($('msgLoggerContainer'), $('msgLogger'));
// core.Monitor.setInstance(monitor);
var container = $('mindplot');
@ -526,8 +434,7 @@ function buildMindmapDesigner()
// Save map on load ....
if (editorProperties.saveOnLoad)
{
if (editorProperties.saveOnLoad) {
var saveOnLoad = function() {
designer.save(function() {
}, false);
@ -537,8 +444,7 @@ function buildMindmapDesigner()
}
;
function createColorPalette(container, onSelectFunction, event)
{
function createColorPalette(container, onSelectFunction, event) {
cleanScreenEvent();
_colorPalette = new core.ColorPicker();
_colorPalette.onSelect = function(color) {
@ -554,10 +460,8 @@ function createColorPalette(container, onSelectFunction, event)
}
;
function cleanScreenEvent()
{
if (this.currentColorPicker)
{
function cleanScreenEvent() {
if (this.currentColorPicker) {
this.currentColorPicker.hide();
}
$("fontFamilyPanel").setStyle('display', "none");
@ -566,33 +470,27 @@ function cleanScreenEvent()
iconPanel.close();
}
function fontFamilyPanel()
{
function fontFamilyPanel() {
var supportedFonts = ['times','arial','tahoma','verdana'];
var updateFunction = function(value)
{
var updateFunction = function(value) {
value = value.charAt(0).toUpperCase() + value.substring(1, value.length);
designer.setFont2SelectedNode(value);
};
var onFocusValue = function(selectedNode)
{
var onFocusValue = function(selectedNode) {
return selectedNode.getFontFamily();
};
buildPanel('fontFamily', 'fontFamilyPanel', supportedFonts, updateFunction, onFocusValue);
}
function shapeTypePanel()
{
function shapeTypePanel() {
var shapeTypePanel = ['rectagle','rounded_rectagle','line','elipse'];
var updateFunction = function(value)
{
var updateFunction = function(value) {
designer.setShape2SelectedNode(value.replace('_', ' '));
};
var onFocusValue = function(selectedNode)
{
var onFocusValue = function(selectedNode) {
return selectedNode.getShapeType().replace(' ', '_');
};
@ -600,32 +498,25 @@ function shapeTypePanel()
buildPanel('topicShape', 'topicShapePanel', shapeTypePanel, updateFunction, onFocusValue);
}
function fontSizePanel()
{
function fontSizePanel() {
var shapeTypePanel = ['small','normal','large','huge'];
var map = {small:'6',normal:'8',large:'10',huge:'15'};
var updateFunction = function(value)
{
var updateFunction = function(value) {
var nodes = designer.getSelectedNodes();
var value = map[value];
designer.setFontSize2SelectedNode(value);
};
var onFocusValue = function(selectedNode)
{
var onFocusValue = function(selectedNode) {
var fontSize = selectedNode.getFontSize();
var result = "";
if (fontSize <= 6)
{
if (fontSize <= 6) {
result = 'small';
} else if (fontSize <= 8)
{
} else if (fontSize <= 8) {
result = 'normal';
} else if (fontSize <= 10)
{
} else if (fontSize <= 10) {
result = 'large';
} else if (fontSize >= 15)
{
} else if (fontSize >= 15) {
result = 'huge';
}
return result;
@ -633,18 +524,15 @@ function fontSizePanel()
buildPanel('fontSize', 'fontSizePanel', shapeTypePanel, updateFunction, onFocusValue);
}
function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunction, onFocusValue)
{
function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunction, onFocusValue) {
// Font family event handling ....
$(buttonElemId).addEvent('click', function(event)
{
$(buttonElemId).addEvent('click', function(event) {
var container = $(elemLinksContainer);
var isRendered = container.getStyle('display') == 'block';
cleanScreenEvent();
// Restore default css.
for (var i = 0; i < elemLinkIds.length; i++)
{
for (var i = 0; i < elemLinkIds.length; i++) {
var elementId = elemLinkIds[i];
$(elementId).className = 'toolbarPanelLink';
}
@ -652,8 +540,7 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
// Select current element ...
var nodes = designer.getSelectedNodes();
var lenght = nodes.length;
if (lenght == 1)
{
if (lenght == 1) {
var selectedNode = nodes[0];
var selectedElementId = onFocusValue(selectedNode);
selectedElementId = selectedElementId.toLowerCase();
@ -664,23 +551,20 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
container.setStyle('display', 'block');
var mouseCoords = core.Utils.getMousePosition(event);
if (!isRendered)
{
if (!isRendered) {
container.setStyle('left', (mouseCoords.x - 10) + "px");
}
});
var fontOnClick = function(event)
{
var fontOnClick = function(event) {
var value = this.getAttribute('id');
updateFunction(value);
cleanScreenEvent();
};
// Register event listeners on elements ...
for (var i = 0; i < elemLinkIds.length; i++)
{
for (var i = 0; i < elemLinkIds.length; i++) {
var elementId = elemLinkIds[i];
$(elementId).addEvent('click', fontOnClick.bind($(elementId)));
}

File diff suppressed because it is too large Load Diff