2009-06-07 20:59:43 +02:00
|
|
|
<%@ include file="/jsp/init.jsp" %>
|
|
|
|
<h1>
|
2012-02-20 01:07:24 +01:00
|
|
|
<spring:message code="EXPORT"/>'${mindmap.title}'</h1>
|
2009-06-07 20:59:43 +02:00
|
|
|
|
|
|
|
<div>
|
2012-02-20 01:07:24 +01:00
|
|
|
<form method="POST" id="exportForm" name="exportForm" action="<c:url value="/service/transform"/>"
|
|
|
|
style="height:100%;" enctype="application/x-www-form-urlencoded">
|
|
|
|
<input name="svgXml" value="" type="hidden"/>
|
|
|
|
<input name="mapXml" value="" type="hidden"/>
|
|
|
|
<input name="filename" value="${mindmap.title}" type="hidden"/>
|
2009-06-07 20:59:43 +02:00
|
|
|
<table>
|
|
|
|
<tbody>
|
2011-10-17 02:42:02 +02:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<input type="radio" id="svg" name="exportFormat" value="SVG"/>
|
2012-04-05 19:18:13 +02:00
|
|
|
<label for="svg">
|
|
|
|
<b>
|
|
|
|
<spring:message code="SVG_EXPORT_FORMAT"/>
|
|
|
|
</b>
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-04-05 19:18:13 +02:00
|
|
|
<p>
|
|
|
|
<spring:message code="SVG_EXPORT_FORMAT_DETAILS"/>
|
|
|
|
</p>
|
|
|
|
</label>
|
2011-10-17 02:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<input type="radio" name="exportFormat" value="PDF" id="pdf"/>
|
2012-04-05 19:18:13 +02:00
|
|
|
<label for="pdf">
|
|
|
|
<b>
|
|
|
|
<spring:message code="PDF_EXPORT_FORMAT"/>
|
|
|
|
</b>
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-04-05 19:18:13 +02:00
|
|
|
<p>
|
|
|
|
<spring:message code="PDF_EXPORT_FORMAT_DETAILS"/>
|
|
|
|
</p>
|
|
|
|
</label>
|
2011-10-17 02:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<input type="radio" id="freemind" name="exportFormat" value="FREEMIND" checked="checked"/>
|
2012-04-05 19:18:13 +02:00
|
|
|
<label for="freemind">
|
|
|
|
<b>
|
|
|
|
<spring:message code="FREEMIND_EXPORT_FORMAT"/>
|
|
|
|
</b>
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-04-05 19:18:13 +02:00
|
|
|
<p>
|
|
|
|
<spring:message code="FREEMIND_EXPORT_FORMAT_DETAILS"/>
|
|
|
|
</p>
|
|
|
|
</label>
|
2011-10-17 02:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<input type="radio" name="exportFormat" id="img" value="IMG_EXPORT_FORMAT"/>
|
|
|
|
<b>
|
|
|
|
<spring:message code="IMG_EXPORT_FORMAT"/>
|
|
|
|
</b><select name="imgFormat" id="imgFormat" style="visibility:hidden;margin-left:5px;">
|
|
|
|
<option>PNG</option>
|
|
|
|
<option>JPEG</option>
|
|
|
|
</select>
|
2012-04-05 19:18:13 +02:00
|
|
|
<label for="img">
|
|
|
|
<p>
|
|
|
|
<spring:message code="IMG_EXPORT_FORMAT_DETAILS"/>
|
|
|
|
</p>
|
|
|
|
</label>
|
2011-10-17 02:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td style="text-align:center;margin-top:10px;">
|
|
|
|
<input type="button" id="ok" value="<spring:message code="OK"/>" class="btn-primary">
|
2011-10-18 14:29:29 +02:00
|
|
|
<input type="button" id="cancel" value="<spring:message code="CANCEL"/>" class="btn-secondary"
|
2012-04-05 19:18:13 +02:00
|
|
|
onclick="MooDialog.Request.active.close()">
|
2011-10-17 02:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2009-06-07 20:59:43 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
2011-10-17 02:42:02 +02:00
|
|
|
|
2009-06-07 20:59:43 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
$('img').addEvent('click', function(event) {
|
|
|
|
$('imgFormat').setStyle('visibility', 'visible');
|
|
|
|
});
|
|
|
|
$('pdf').addEvent('click', function(event) {
|
|
|
|
$('imgFormat').setStyle('visibility', 'hidden');
|
|
|
|
});
|
|
|
|
$('svg').addEvent('click', function(event) {
|
|
|
|
$('imgFormat').setStyle('visibility', 'hidden');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('ok').addEvent('click', function(event) {
|
|
|
|
|
2012-02-20 01:07:24 +01:00
|
|
|
var form = $('exportForm');
|
|
|
|
|
|
|
|
// Look for the selected format and append export suffix...
|
|
|
|
var value = $$('input[name=exportFormat]:checked')[0].get('value');
|
|
|
|
var suffix;
|
|
|
|
if (value == 'IMG_EXPORT_FORMAT') {
|
|
|
|
var selected = $('imgFormat');
|
|
|
|
suffix = selected.options[selected.selectedIndex].value;
|
|
|
|
} else {
|
|
|
|
suffix = value;
|
|
|
|
}
|
|
|
|
suffix = suffix.toLowerCase();
|
|
|
|
form.action = form.action + "." + suffix;
|
|
|
|
|
|
|
|
// Store SVG o native map...
|
|
|
|
if (suffix == "freemind") {
|
|
|
|
var mindmap = designer.getMindmap();
|
2012-02-26 03:32:15 +01:00
|
|
|
var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap);
|
2012-02-20 01:07:24 +01:00
|
|
|
var domMap = serializer.toXML(mindmap);
|
|
|
|
form.mapXml.value = core.Utils.innerXML(domMap);
|
|
|
|
} else {
|
|
|
|
form.svgXml.value = $("workspaceContainer").innerHTML;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally, submit map ...
|
|
|
|
form.submit();
|
2011-10-18 14:29:29 +02:00
|
|
|
MooDialog.Request.active.close();
|
|
|
|
});
|
|
|
|
|
2009-06-07 20:59:43 +02:00
|
|
|
</script>
|