More refactors.

This commit is contained in:
Paulo Veiga
2012-02-04 12:51:50 -03:00
parent 0101ec2ae7
commit 6f7567abea
19 changed files with 348 additions and 694 deletions

View File

@@ -19,64 +19,33 @@
<script type="text/javascript">
var mapId = 'welcome';
$(document).addEvent('loadcomplete', function(resource) {
var options = loadDesignerOptions();
// Options has been defined in by a external ile ?
var uri = new URI(window.location);
var query = String.parseQueryString(uri.get('query'));
var confUrl = query.confUrl;
var options = loadDesignerOptions(confUrl);
var designer = buildDesigner(options);
// Load map from XML ...
var mapId = options.mapId ? options.mapId : 'welcome';
var persistence = mindplot.PersistenceManager.getInstance();
var mindmap;
try {
var persistence = mindplot.PersistenceManager.getInstance();
mindmap = persistence.load(mapId);
} catch(e) {
// If the map could not be loaded, create a new empty map...
mindmap = mindplot.model.Mindmap.buildEmpty(mapId);
}
designer.loadMap(mindmap);
// If not problem has arisen, close the dialog ...
if (!window.hasUnexpectedErrors) {
waitDialog.deactivate();
}
});
</script>
</head>
<body>
<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;
});
</script>
<div id="header">
<div id="headerInfo">