wisemapping-open-source/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp

100 lines
3.8 KiB
Plaintext
Raw Normal View History

2009-06-07 20:59:43 +02:00
<%@ include file="/jsp/init.jsp" %>
<p>
<spring:message code="EXPORT_DETAILS"/>
</p>
2009-06-07 20:59:43 +02:00
<div>
<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>
<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>
<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"/>
<select name="imgFormat" id="imgFormat" style="display:none">
<option value='png'>PNG</option>
2012-06-03 23:12:56 +02:00
<option value='jpg'>JPEG</option>
2011-10-17 02:42:02 +02:00
</select>
</label>
</fieldset>
2009-06-07 20:59:43 +02:00
</form>
</div>
<p>
<span class="alert alert-info" id="exportInfo"><i class="icon-info-sign"></i> <spring:message
code="EXPORT_FORMAT_RESTRICTIONS"/></span>
</p>
2011-10-17 02:42:02 +02:00
2009-06-07 20:59:43 +02:00
<script type="text/javascript">
// 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();
});
$('#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);
}
$('#dialogMainForm input[name=download]').attr('value', formatType);
form.submit();
// Close dialog ...
$('#export-dialog-modal').modal('hide');
}
2011-10-18 14:29:29 +02:00
2009-06-07 20:59:43 +02:00
</script>