mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-25 23:44:54 +01:00
Working on samples.
This commit is contained in:
parent
b6dd7712f9
commit
8db3e88ad9
@ -27,7 +27,7 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Dispatcher manager ...
|
||||
var commandContext = new mindplot.CommandContext(this);
|
||||
if (options.collab == 'standalone') {
|
||||
if (!$defined(options.collab) || options.collab == 'standalone') {
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
} else {
|
||||
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
|
||||
|
@ -14,10 +14,8 @@
|
||||
|
||||
<h1>Embedded editor sample</h1>
|
||||
|
||||
<h2></h2>
|
||||
|
||||
<div style="text-align:center">
|
||||
<iframe src="editor.html?width=800&height=600" width="800" height="600"></iframe>
|
||||
<div style="text-align:right">
|
||||
<iframe src="editor.html?confUrl=../html/container.json" width="800" height="600"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
9
wise-editor/src/main/webapp/html/container.json
Normal file
9
wise-editor/src/main/webapp/html/container.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"readOnly":"false",
|
||||
"zoom":0.85,
|
||||
"saveOnLoad":false,
|
||||
"size":{
|
||||
"width":800,
|
||||
"height":600
|
||||
}
|
||||
}
|
@ -20,10 +20,9 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
var mapId = 'welcome';
|
||||
var viewMode = false;
|
||||
$(document).addEvent('loadcomplete', function(resource) {
|
||||
|
||||
var designer = buildDesigner(viewMode);
|
||||
var options = loadDesignerOptions();
|
||||
var designer = buildDesigner(options);
|
||||
|
||||
// Configure default persistence manager ...
|
||||
mindplot.PersistenceManager.init(new mindplot.LocalStorageManager());
|
||||
@ -45,6 +44,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -1,6 +1,13 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV="REFRESH" content="0; url=html/editor.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a href="html/container.html">Embedding the mindmap in a page</a>
|
||||
<a href="html/editor.html">Full page</a>
|
||||
<a href="html/viewmode.html">Read Only version</a>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -18,30 +18,20 @@
|
||||
|
||||
var designer = null;
|
||||
|
||||
function buildDesigner(viewMode, containerSize) {
|
||||
function buildDesigner(options) {
|
||||
|
||||
var container = $('mindplot');
|
||||
container.setStyles(options.size);
|
||||
|
||||
// Set workspace size ...
|
||||
if (!containerSize) {
|
||||
containerSize = {
|
||||
// Set workspace screen size as default. In this way, resize issues are solved.
|
||||
height: parseInt(screen.height),
|
||||
width: parseInt(screen.width)
|
||||
}
|
||||
}
|
||||
container.setStyles(containerSize);
|
||||
|
||||
var editorProperties = {zoom:0.85,saveOnLoad:true,collab:'standalone',readOnly:viewMode};
|
||||
designer = new mindplot.Designer(editorProperties, container);
|
||||
designer = new mindplot.Designer(options, container);
|
||||
designer.setViewPort({
|
||||
height: parseInt(window.innerHeight - 70), // Footer and Header
|
||||
width: parseInt(window.innerWidth)
|
||||
});
|
||||
|
||||
if (!viewMode) {
|
||||
if (!options.readOnly) {
|
||||
if ($('toolbar')) {
|
||||
var menu = new mindplot.widget.Menu(designer, 'toolbar', mapId);
|
||||
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() {
|
||||
@ -52,4 +42,38 @@ function buildDesigner(viewMode, containerSize) {
|
||||
return designer;
|
||||
}
|
||||
|
||||
|
||||
function loadDesignerOptions() {
|
||||
// Load map options ...
|
||||
var uri = new URI(window.location);
|
||||
var query = String.parseQueryString(uri.get('query'));
|
||||
var jsonConf = query.confUrl;
|
||||
var result;
|
||||
if (jsonConf) {
|
||||
|
||||
var request = new Request.JSON({
|
||||
url: jsonConf,
|
||||
async:false,
|
||||
onSuccess:
|
||||
function(options) {
|
||||
this.options = options;
|
||||
|
||||
}.bind(this)
|
||||
}
|
||||
);
|
||||
request.get();
|
||||
result = this.options;
|
||||
}
|
||||
else {
|
||||
// Set workspace screen size as default. In this way, resize issues are solved.
|
||||
var containerSize = {
|
||||
height: parseInt(screen.height),
|
||||
width: parseInt(screen.width)
|
||||
};
|
||||
result = {readOnly:true,zoom:0.85,saveOnLoad:true,size:containerSize};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Asset.javascript("../js/mindplot-min.js");
|
||||
|
Loading…
Reference in New Issue
Block a user