- Remove .htm
- Keep working on export.
This commit is contained in:
@@ -1,125 +1,100 @@
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<h1>
|
||||
<spring:message code="EXPORT"/>'${mindmap.title}'</h1>
|
||||
|
||||
<p>
|
||||
<spring:message code="EXPORT_DETAILS"/>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<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"/>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="radio" id="svg" name="exportFormat" value="SVG"/>
|
||||
<label for="svg">
|
||||
<b>
|
||||
<spring:message code="SVG_EXPORT_FORMAT"/>
|
||||
</b>
|
||||
<form method="GET" class="form-horizontal" action="service/maps/${mindmap.id}"
|
||||
enctype="application/x-www-form-urlencoded" id="dialogMainForm">
|
||||
<input name="svgXml" id="svgXml" value="" type="hidden"/>
|
||||
<input name="download" type="hidden" value="mm"/>
|
||||
<fieldset>
|
||||
<label for="freemind">
|
||||
<input type="radio" id="freemind" name="exportFormat" value="mm" checked="checked"/>
|
||||
<strong><spring:message code="FREEMIND_EXPORT_FORMAT"/></strong><br/>
|
||||
<spring:message code="FREEMIND_EXPORT_FORMAT_DETAILS"/>
|
||||
</label>
|
||||
<label for="wisemapping">
|
||||
<input type="radio" id="wisemapping" name="exportFormat" value="wxml"/>
|
||||
<strong><spring:message code="WISEMAPPING_EXPORT_FORMAT"/></strong><br/>
|
||||
<spring:message code="WISEMAPPING_EXPORT_FORMAT_DETAILS"/>
|
||||
</label>
|
||||
<label for="svg">
|
||||
<input type="radio" id="svg" name="exportFormat" value="svg"/>
|
||||
<strong><spring:message code="SVG_EXPORT_FORMAT"/></strong><br/>
|
||||
<spring:message code="SVG_EXPORT_FORMAT_DETAILS"/>
|
||||
</label>
|
||||
|
||||
<p>
|
||||
<spring:message code="SVG_EXPORT_FORMAT_DETAILS"/>
|
||||
</p>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="radio" name="exportFormat" value="PDF" id="pdf"/>
|
||||
<label for="pdf">
|
||||
<b>
|
||||
<spring:message code="PDF_EXPORT_FORMAT"/>
|
||||
</b>
|
||||
<label for="pdf">
|
||||
<input type="radio" name="exportFormat" value="pdf" id="pdf"/>
|
||||
<strong><spring:message code="PDF_EXPORT_FORMAT"/></strong><br/>
|
||||
<spring:message code="PDF_EXPORT_FORMAT_DETAILS"/>
|
||||
</label>
|
||||
|
||||
<p>
|
||||
<spring:message code="PDF_EXPORT_FORMAT_DETAILS"/>
|
||||
</p>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="radio" id="freemind" name="exportFormat" value="FREEMIND" checked="checked"/>
|
||||
<label for="freemind">
|
||||
<b>
|
||||
<spring:message code="FREEMIND_EXPORT_FORMAT"/>
|
||||
</b>
|
||||
<label for="img">
|
||||
<input type="radio" name="exportFormat" id="img" value="image"/>
|
||||
<strong><spring:message code="IMG_EXPORT_FORMAT"/></strong><br/>
|
||||
<spring:message code="IMG_EXPORT_FORMAT_DETAILS"/>
|
||||
|
||||
<p>
|
||||
<spring:message code="FREEMIND_EXPORT_FORMAT_DETAILS"/>
|
||||
</p>
|
||||
</label>
|
||||
</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 name="imgFormat" id="imgFormat" style="display:none">
|
||||
<option value='png'>PNG</option>
|
||||
<option value='jpeg'>JPEG</option>
|
||||
</select>
|
||||
<label for="img">
|
||||
<p>
|
||||
<spring:message code="IMG_EXPORT_FORMAT_DETAILS"/>
|
||||
</p>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;margin-top:10px;">
|
||||
<input type="button" id="ok" value="<spring:message code="OK"/>" class="btn-primary">
|
||||
<input type="button" id="cancel" value="<spring:message code="CANCEL"/>" class="btn-secondary"
|
||||
onclick="MooDialog.Request.active.close()">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</label>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<p>
|
||||
<span class="alert alert-info" id="exportInfo"><i class="icon-info-sign"></i> <spring:message
|
||||
code="EXPORT_FORMAT_RESTRICTIONS"/></span>
|
||||
</p>
|
||||
|
||||
|
||||
<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) {
|
||||
// No way to obtain map svg. Hide panels..
|
||||
if (window.location.pathname.indexOf('exportf') != -1) {
|
||||
$('#exportInfo').hide();
|
||||
$('#freemind,#pdf,#svg').click('click', function(event) {
|
||||
$('#imgFormat').hide();
|
||||
});
|
||||
|
||||
var form = $('exportForm');
|
||||
$('#img').click('click', function(event) {
|
||||
$('#imgFormat').show();
|
||||
});
|
||||
} else {
|
||||
$('#pdf,#svg,#img').parent().hide();
|
||||
}
|
||||
|
||||
function submitDialogForm() {
|
||||
// If the map is opened, use the latest model ...
|
||||
var formatType = $('#dialogMainForm input:checked').attr('value');
|
||||
var form = $('#dialogMainForm');
|
||||
|
||||
// Restore default ..
|
||||
form.attr('action', 'service/maps/${mindmap.id}.' + formatType);
|
||||
|
||||
if (formatType == 'image' || formatType == 'svg' || formatType == 'pdf') {
|
||||
|
||||
// Look for the selected format and append export suffix...
|
||||
if (formatType == 'image') {
|
||||
formatType = $('#dialogMainForm option:selected').attr('value');
|
||||
}
|
||||
// Change to transform url ...
|
||||
form.attr('method', "POST");
|
||||
form.attr('action', 'service/transform.' + formatType);
|
||||
|
||||
// Load page SVG ...
|
||||
var svg = window.parent.document.getElementById('workspaceContainer').innerHTML;
|
||||
$('#svgXml').attr('value', svg);
|
||||
|
||||
// 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();
|
||||
var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap);
|
||||
var domMap = serializer.toXML(mindmap);
|
||||
form.mapXml.value = core.Utils.innerXML(domMap);
|
||||
} else {
|
||||
form.svgXml.value = $("workspaceContainer").innerHTML;
|
||||
}
|
||||
|
||||
// Finally, submit map ...
|
||||
$('#dialogMainForm input[name=download]').attr('value', formatType);
|
||||
form.submit();
|
||||
MooDialog.Request.active.close();
|
||||
});
|
||||
|
||||
// Close dialog ...
|
||||
$('#export-dialog-modal').modal('hide');
|
||||
}
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user