mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Working on samples.
This commit is contained in:
parent
b6dd7712f9
commit
8db3e88ad9
@ -27,7 +27,7 @@ mindplot.Designer = new Class({
|
|||||||
|
|
||||||
// Dispatcher manager ...
|
// Dispatcher manager ...
|
||||||
var commandContext = new mindplot.CommandContext(this);
|
var commandContext = new mindplot.CommandContext(this);
|
||||||
if (options.collab == 'standalone') {
|
if (!$defined(options.collab) || options.collab == 'standalone') {
|
||||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||||
} else {
|
} else {
|
||||||
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
|
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
|
|
||||||
<h1>Embedded editor sample</h1>
|
<h1>Embedded editor sample</h1>
|
||||||
|
|
||||||
<h2></h2>
|
<div style="text-align:right">
|
||||||
|
<iframe src="editor.html?confUrl=../html/container.json" width="800" height="600"></iframe>
|
||||||
<div style="text-align:center">
|
|
||||||
<iframe src="editor.html?width=800&height=600" width="800" height="600"></iframe>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var mapId = 'welcome';
|
var mapId = 'welcome';
|
||||||
var viewMode = false;
|
|
||||||
$(document).addEvent('loadcomplete', function(resource) {
|
$(document).addEvent('loadcomplete', function(resource) {
|
||||||
|
var options = loadDesignerOptions();
|
||||||
var designer = buildDesigner(viewMode);
|
var designer = buildDesigner(options);
|
||||||
|
|
||||||
// Configure default persistence manager ...
|
// Configure default persistence manager ...
|
||||||
mindplot.PersistenceManager.init(new mindplot.LocalStorageManager());
|
mindplot.PersistenceManager.init(new mindplot.LocalStorageManager());
|
||||||
@ -45,6 +44,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV="REFRESH" content="0; url=html/editor.html">
|
|
||||||
</head>
|
</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>
|
</html>
|
||||||
|
@ -18,30 +18,20 @@
|
|||||||
|
|
||||||
var designer = null;
|
var designer = null;
|
||||||
|
|
||||||
function buildDesigner(viewMode, containerSize) {
|
function buildDesigner(options) {
|
||||||
|
|
||||||
var container = $('mindplot');
|
var container = $('mindplot');
|
||||||
|
container.setStyles(options.size);
|
||||||
|
|
||||||
// Set workspace size ...
|
designer = new mindplot.Designer(options, container);
|
||||||
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.setViewPort({
|
designer.setViewPort({
|
||||||
height: parseInt(window.innerHeight - 70), // Footer and Header
|
height: parseInt(window.innerHeight - 70), // Footer and Header
|
||||||
width: parseInt(window.innerWidth)
|
width: parseInt(window.innerWidth)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!viewMode) {
|
if (!options.readOnly) {
|
||||||
if ($('toolbar')) {
|
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.
|
// If a node has focus, focus can be move to another node using the keys.
|
||||||
designer._cleanScreen = function() {
|
designer._cleanScreen = function() {
|
||||||
@ -52,4 +42,38 @@ function buildDesigner(viewMode, containerSize) {
|
|||||||
return designer;
|
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");
|
Asset.javascript("../js/mindplot-min.js");
|
||||||
|
Loading…
Reference in New Issue
Block a user