mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
- Try to catch more exception details.
This commit is contained in:
parent
f5d3b51f6e
commit
88f5f1a5bd
@ -13,15 +13,9 @@ $defined = function (obj) {
|
|||||||
|
|
||||||
$assert = function (assert, message) {
|
$assert = function (assert, message) {
|
||||||
if (!$defined(assert) || !assert) {
|
if (!$defined(assert) || !assert) {
|
||||||
var stack;
|
logStackTrace();
|
||||||
try {
|
console.log(message);
|
||||||
throw Error("Unexpected Exception");
|
throw new Error(message);
|
||||||
} catch (e) {
|
|
||||||
stack = e;
|
|
||||||
}
|
|
||||||
console.log(message + "," + stack);
|
|
||||||
window.errorStack = stackTrace();
|
|
||||||
throw message;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,7 +23,7 @@ Math.sign = function (value) {
|
|||||||
return (value >= 0) ? 1 : -1;
|
return (value >= 0) ? 1 : -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
function stackTrace(exception) {
|
function logStackTrace(exception) {
|
||||||
|
|
||||||
if (!$defined(exception)) {
|
if (!$defined(exception)) {
|
||||||
try {
|
try {
|
||||||
@ -54,7 +48,7 @@ function stackTrace(exception) {
|
|||||||
currentFunction = currentFunction.caller;
|
currentFunction = currentFunction.caller;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
window.errorStack = result;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,74 +270,6 @@ editor.FatalErrorDialog = new Class({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
editor.Help = {
|
|
||||||
buildHelp:function (panel) {
|
|
||||||
var container = new Element('div');
|
|
||||||
container.setStyles({width:'100%', textAlign:'center'});
|
|
||||||
var content1 = Help.buildContentIcon('images/black-keyboard.png', 'Keyboard Shortcuts', function () {
|
|
||||||
MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false);
|
|
||||||
panel.hidePanel();
|
|
||||||
});
|
|
||||||
var content2 = Help.buildContentIcon('images/firstSteps.png', 'Editor First Steps', function () {
|
|
||||||
var wOpen;
|
|
||||||
var sOptions;
|
|
||||||
|
|
||||||
sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
|
|
||||||
sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
|
|
||||||
sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
|
|
||||||
sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';
|
|
||||||
|
|
||||||
wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px");
|
|
||||||
wOpen.focus();
|
|
||||||
wOpen.moveTo(0, 0);
|
|
||||||
wOpen.resizeTo(screen.availWidth, screen.availHeight);
|
|
||||||
panel.hidePanel();
|
|
||||||
});
|
|
||||||
|
|
||||||
container.addEvent('show', function () {
|
|
||||||
content1.effect('opacity', {duration:800}).start(0, 100);
|
|
||||||
var eff = function () {
|
|
||||||
content2.effect('opacity', {duration:800}).start(0, 100);
|
|
||||||
};
|
|
||||||
eff.delay(150);
|
|
||||||
});
|
|
||||||
container.addEvent('hide', function () {
|
|
||||||
content1.effect('opacity').set(0);
|
|
||||||
content2.effect('opacity').set(0)
|
|
||||||
});
|
|
||||||
content1.inject(container);
|
|
||||||
content2.inject(container);
|
|
||||||
return container;
|
|
||||||
},
|
|
||||||
buildContentIcon:function (image, text, onClickFn) {
|
|
||||||
var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border:'1px solid transparent', cursor:'pointer'});
|
|
||||||
|
|
||||||
var icon = new Element('div');
|
|
||||||
icon.addEvent('click', onClickFn);
|
|
||||||
var img = new Element('img');
|
|
||||||
img.setProperty('src', image);
|
|
||||||
img.inject(icon);
|
|
||||||
icon.inject(container);
|
|
||||||
|
|
||||||
var textContainer = new Element('div').setStyles({width:'100%', color:'white'});
|
|
||||||
textContainer.innerHTML = text;
|
|
||||||
textContainer.inject(container);
|
|
||||||
|
|
||||||
container.addEvent('mouseover', function () {
|
|
||||||
$(this).setStyle('border-top', '1px solid #BBB4D6');
|
|
||||||
$(this).setStyle('border-bottom', '1px solid #BBB4D6');
|
|
||||||
}.bind(this));
|
|
||||||
container.addEvent('mouseout', function () {
|
|
||||||
$(this).setStyle('border-top', '1px solid transparent');
|
|
||||||
$(this).setStyle('border-bottom', '1px solid transparent');
|
|
||||||
|
|
||||||
}.bind(this));
|
|
||||||
return container;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Show loading dialog ...
|
// Show loading dialog ...
|
||||||
waitDialog = new editor.WaitDialog();
|
waitDialog = new editor.WaitDialog();
|
||||||
waitDialog.show();
|
waitDialog.show();
|
||||||
|
@ -28,31 +28,36 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).addEvent('loadcomplete', function (resource) {
|
$(document).addEvent('loadcomplete', function (resource) {
|
||||||
var mapId = '${mindmap.id}';
|
try {
|
||||||
var mapXml = '${mindmap.xmlAsJsLiteral}';
|
var mapId = '${mindmap.id}';
|
||||||
|
var mapXml = '${mindmap.xmlAsJsLiteral}';
|
||||||
|
|
||||||
// Configure designer options ...
|
// Configure designer options ...
|
||||||
var options = loadDesignerOptions();
|
var options = loadDesignerOptions();
|
||||||
<c:if test="${!memoryPersistence}">
|
<c:if test="${!memoryPersistence}">
|
||||||
options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/{id}/document", "service/maps/{id}/history/latest");
|
options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/{id}/document", "service/maps/{id}/history/latest");
|
||||||
</c:if>
|
</c:if>
|
||||||
var userOptions = ${mindmap.properties};
|
var userOptions = ${mindmap.properties};
|
||||||
options.zoom = userOptions.zoom;
|
options.zoom = userOptions.zoom;
|
||||||
options.readOnly = ${!!readOnlyMode};
|
options.readOnly = ${!!readOnlyMode};
|
||||||
options.locale = '${locale}';
|
options.locale = '${locale}';
|
||||||
|
|
||||||
// Set map id ...
|
// Set map id ...
|
||||||
options.mapId = mapId;
|
options.mapId = mapId;
|
||||||
|
|
||||||
// Build designer ...
|
// Build designer ...
|
||||||
var designer = buildDesigner(options);
|
var designer = buildDesigner(options);
|
||||||
|
|
||||||
// Load map from XML ...
|
// Load map from XML ...
|
||||||
var parser = new DOMParser();
|
var parser = new DOMParser();
|
||||||
var domDocument = parser.parseFromString(mapXml, "text/xml");
|
var domDocument = parser.parseFromString(mapXml, "text/xml");
|
||||||
|
|
||||||
var mindmap = mindplot.PersistenceManager.loadFromDom(mapId, domDocument);
|
var mindmap = mindplot.PersistenceManager.loadFromDom(mapId, domDocument);
|
||||||
designer.loadMap(mindmap);
|
designer.loadMap(mindmap);
|
||||||
|
} catch (e) {
|
||||||
|
logStackTrace(e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user