More refactors.
This commit is contained in:
@@ -1,60 +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.
|
||||
*/
|
||||
Asset.javascript('../js/mindplot-min.js', {
|
||||
id: 'MindplotSVGLib',
|
||||
onLoad: function() {
|
||||
$(document).fireEvent('loadcomplete', 'mind')
|
||||
}
|
||||
});
|
||||
|
||||
var designer = null;
|
||||
/* JavaScript tabs changer */
|
||||
|
||||
function setUpToolbar(designer, readOnly) {
|
||||
|
||||
var menu = new mindplot.widget.Menu(designer, 'toolbar', mapId);
|
||||
|
||||
// If a node has focus, focus can be move to another node using the keys.
|
||||
designer._cleanScreen = function() {
|
||||
menu.clear()
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
function buildDesigner(properties) {
|
||||
$assert(properties, "properties can not be null");
|
||||
|
||||
var container = $('mindplot');
|
||||
container.setStyles({
|
||||
height: parseInt(screen.height),
|
||||
width: parseInt(screen.width)
|
||||
});
|
||||
|
||||
designer = new mindplot.Designer(properties, container);
|
||||
designer.setViewPort({
|
||||
height: parseInt(window.innerHeight - 151), // Footer and Header
|
||||
width: parseInt(window.innerWidth)
|
||||
});
|
||||
|
||||
// Toolbar is only loaded if it was defined ...
|
||||
if ($('toolbar')) {
|
||||
setUpToolbar(designer, properties.readOnly);
|
||||
}
|
||||
return designer;
|
||||
}
|
@@ -14,53 +14,43 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<![endif]-->
|
||||
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet/less" type="text/css" href="../css/editor.less"/>
|
||||
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="../dwr/interface/MapEditorService.js"></script>
|
||||
<script type="text/javascript" src="../dwr/interface/LoggerService.js"></script>
|
||||
|
||||
<script type='text/javascript' src='../js/mootools-core-1.3.2.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-more-1.3.2.js'></script>
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
<script type='text/javascript' src='../js/less-1.1.3.min.js'></script>
|
||||
|
||||
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
|
||||
<script type="text/javascript">
|
||||
var mapId = '${mindmap.id}';
|
||||
var mapXml = '${mapXml}';
|
||||
var mindReady = false;
|
||||
|
||||
$(document).addEvent('loadcomplete', function(resource) {
|
||||
mindReady = resource == 'mind' ? true : mindReady;
|
||||
if (mindReady) {
|
||||
// Configure default persistence ...
|
||||
mindplot.PersistenceManager.init(new mindplot.DwrPersitenceManager());
|
||||
var persistence = mindplot.PersistenceManager.getInstance();
|
||||
var mapId = '${mindmap.id}';
|
||||
var mapXml = '${mapXml}';
|
||||
|
||||
// Initialize editor ...
|
||||
var editorProperties = ${mindmap.properties};
|
||||
editorProperties.collab = 'standalone';
|
||||
editorProperties.readOnly = false;
|
||||
designer = buildDesigner(editorProperties);
|
||||
// Configure designer options ...
|
||||
var options = loadDesignerOptions();
|
||||
options.persistenceManager = "mindplot.DwrPersitenceManager";
|
||||
var userOptions = ${mindmap.properties};
|
||||
options.zoom = userOptions.zoom;
|
||||
|
||||
var domDocument = core.Utils.createDocumentFromText(mapXml);
|
||||
var mindmap = persistence.loadFromDom(mapId, domDocument);
|
||||
// Build designer ...
|
||||
var designer = buildDesigner(options);
|
||||
|
||||
// Now, load the map ...
|
||||
designer.loadMap(mindmap);
|
||||
|
||||
// If not problem has arisen, close the dialog ...
|
||||
if (!window.hasUnexpectedErrors) {
|
||||
waitDialog.deactivate();
|
||||
}
|
||||
}
|
||||
// Load map from XML ...
|
||||
var domDocument = core.Utils.createDocumentFromText(mapXml);
|
||||
var persistence = mindplot.PersistenceManager.getInstance();
|
||||
var mindmap = persistence.loadFromDom(mapId, domDocument);
|
||||
designer.loadMap(mindmap);
|
||||
});
|
||||
</script>
|
||||
|
||||
function printMap() {
|
||||
document.printForm.mapSvg.value = $("workspaceContainer").innerHTML;
|
||||
document.printForm.submit();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -71,42 +61,6 @@
|
||||
<input type="hidden" name="mapSvg" value="">
|
||||
</form>
|
||||
|
||||
<div id="waitDialog" style="display:none">
|
||||
<div id="waitingContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
Loading ...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorDialog" style="display:none">
|
||||
<div id="errorContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
Unexpected error loading your map :(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var waitDialog = new core.WaitDialog();
|
||||
waitDialog.activate(true, $("waitDialog"));
|
||||
$(window).addEvent("error", function(event) {
|
||||
|
||||
// Show error dialog ...
|
||||
waitDialog.changeContent($("errorDialog"), false);
|
||||
return false;
|
||||
});
|
||||
|
||||
function printMap() {
|
||||
document.printForm.mapSvg.value = $("workspaceContainer").innerHTML;
|
||||
document.printForm.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div id="actionsContainer"></div>
|
||||
<div>
|
||||
<c:url value="mymaps.htm" var="shareMap">
|
||||
|
@@ -39,7 +39,7 @@
|
||||
<div id="deleteTopic" class="buttonOn" title="Delete">
|
||||
<img src="../images/topic-delete.png"/>
|
||||
</div>
|
||||
<div id="topicBorder" class="buttonOn" title="Border Color">
|
||||
<div id="topicBorder" class="buttonExtOn" title="Border Color">
|
||||
<img src="../images/topic-border.png"/>
|
||||
</div>
|
||||
<div id="topicColor" class="buttonExtOn" title="Background Color">
|
||||
|
Reference in New Issue
Block a user