support both export versions for freemind (old and new 1.0.1)

This commit is contained in:
Claudio Barril
2014-09-07 16:06:58 -03:00
parent 369f015af2
commit 26a18ae7d0
16 changed files with 68 additions and 26 deletions

View File

@@ -26,6 +26,7 @@
var svgXml = context.method == "POST" ? window.document.getElementById('workspaceContainer').innerHTML : "";
$('svgXml').setAttribute('value', svgXml);
$('download').setAttribute('value', context.formatType);
$('version').setAttribute('value', context.version);
iframeForm.submit();
}
if (MooDialog.Request.active) {
@@ -44,4 +45,5 @@
enctype="application/x-www-form-urlencoded" id="iframeExportForm">
<input name="svgXml" id="svgXml" value="" type="hidden"/>
<input name="download" id="download" type="hidden" value="mm"/>
<input name="version" id="version" type="hidden" value=""/>
</form>

View File

@@ -10,11 +10,17 @@
enctype="application/x-www-form-urlencoded" id="dialogMainForm">
<input name="svgXml" id="svgXml" value="" type="hidden"/>
<input name="download" type="hidden" value="mm"/>
<input name="version" type="hidden" value=""/>
<fieldset>
<label for="freemind">
<input type="radio" id="freemind" name="exportFormat" value="mm" checked="checked"/>
<input type="radio" id="freemind" name="exportFormat" value="mm" version="1.0.1" checked="checked"/>
<strong><spring:message code="FREEMIND_EXPORT_FORMAT"/></strong><br/>
</label>
<label for="freemind09">
<input type="radio" id="freemind09" name="exportFormat" value="mm" version="0.9.0"/>
<strong><spring:message code="FREEMIND_EXPORT_FORMAT_09"/></strong><br/>
<spring:message code="FREEMIND_EXPORT_FORMAT_DETAILS"/>
</label>
@@ -87,7 +93,7 @@
// No way to obtain map svg. Hide panels..
if (window.location.pathname.indexOf('exportf') != -1) {
$('#exportInfo').hide();
$('#freemind,#pdf,#svg,#odt,#txt,#xls,#mmap').click('click', function (event) {
$('#freemind,#freemind09,#pdf,#svg,#odt,#txt,#xls,#mmap').click('click', function (event) {
$('#imgFormat').hide();
});
@@ -103,7 +109,6 @@
// If the map is opened, use the latest model ...
var formatType = $('#dialogMainForm input:checked').attr('value');
var form = $('#dialogMainForm');
// Restore default ..
form.attr('action', 'c/restful/maps/${mindmap.id}.' + formatType);
@@ -123,6 +128,11 @@
}
var version = $('#dialogMainForm input:checked').attr('version');
if (version) {
$('#dialogMainForm input[name=version]').attr('value', version);
}
$('#dialogMainForm input[name=download]').attr('value', formatType);
if (!differ) {
form.submit();
@@ -131,7 +141,7 @@
// Close dialog ...
$('#export-dialog-modal').modal('hide');
return {"action":form.attr('action'), "method":form.attr('method'), formatType:formatType};
return {"action":form.attr('action'), "method":form.attr('method'), "formatType":formatType, "version": version};
}
</script>