Merge remote-tracking branch 'origin/develop' into feature/remove_mootols

Conflicts:
	mindplot/src/main/javascript/widget/LinkIconTooltip.js
	wise-webapp/src/main/webapp/jsp/mindmapExport.jsp
This commit is contained in:
Ezequiel Bergamaschi
2014-09-26 23:24:41 -03:00
151 changed files with 10302 additions and 10359 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,10 +10,16 @@
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>
@@ -98,7 +104,7 @@
// No way to obtain map svg. Hide panels..
if (window.location.pathname.match(/\/[0-9]+\/edit/)) {
$('#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();
});
@@ -114,7 +120,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);
@@ -134,6 +139,11 @@
}
var version = $('#dialogMainForm input:checked').attr('version');
if (version) {
$('#dialogMainForm input[name=version]').attr('value', version);
}
$('#dialogMainForm input[name=download]').attr('value', formatType);
form.submit();

View File

@@ -25,7 +25,7 @@
<div class="form-group">
<label for="description" class="control-label col-md-2"><spring:message code="DESCRIPTION"/>: </label>
<div class="col-md-10">
<textarea type="text" name="description" id="description"
<textarea name="description" id="description"
placeholder="<spring:message code="MAP_DESCRIPTION_HINT"/>" class="form-control" maxlength="255"></textarea>
</div>
</div>
@@ -46,12 +46,46 @@
$('#dialogMainForm').submit(function (event) {
// Load form parameters ...
var title = $('#dialogMainForm #title').attr('value');
var title = $('#dialogMainForm #title').val();
title = title == undefined ? "" : title;
var description = $('#dialogMainForm #description').attr('value');
var description = $('#dialogMainForm #description').val();
description = description == undefined ? "" : description;
var onSuccess = function (data, textStatus, jqXHR) {
var resourceId = data.getResponseHeader("ResourceId");
window.location = "c/maps/" + resourceId + "/edit";
};
var onError = function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 400) {
var errors = JSON.parse(jqXHR.responseText);
// Mark fields with errors ...
var fieldErrors = errors.fieldErrors;
if (fieldErrors) {
for (var fieldName in fieldErrors) {
// Mark the field with errors ...
var message = fieldErrors[fieldName];
var inputField = $("#dialogMainForm input[name='" + fieldName + "']");
$("#dialogMainForm").find(".errorMessage").text(message).addClass("alert alert-danger");
inputField.parent().addClass('error');
}
}
var globalErrors = errors.globalErrors;
if (globalErrors) {
for (var error in globalErrors) {
// Mark the field with errors ...
$("#dialogMainForm").find(".errorMessage").text(error).addClass("alert alert-danger");
inputField.parent().addClass('error');
}
}
} else {
console.log(errorThrown);
console.log(jqXHR);
$('#messagesPanel div').text(errorThrown).parent().show();
}
};
// Save status on click ...
jQuery.ajax("c/restful/maps?title=" + encodeURI(title) + "&description=" + encodeURI(description),
{
@@ -60,37 +94,10 @@
type:'POST',
dataType:'json',
contentType:contentType,
success:function (data, textStatus, jqXHR) {
var resourceId = jqXHR.getResponseHeader("ResourceId");
window.location = "c/maps/" + resourceId + "/edit";
},
error:function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 400) {
var errors = JSON.parse(jqXHR.responseText);
// Mark fields with errors ...
var fieldErrors = errors.fieldErrors;
if (fieldErrors) {
for (var fieldName in fieldErrors) {
// Mark the field with errors ...
var message = fieldErrors[fieldName];
var inputField = $("#dialogMainForm input[name='" + fieldName + "']");
$("#dialogMainForm").find(".errorMessage").text(message).addClass("alert alert-danger");
inputField.parent().addClass('error');
}
}
var globalErrors = errors.globalErrors;
if (globalErrors) {
for (var error in globalErrors) {
// Mark the field with errors ...
$("#dialogMainForm").find(".errorMessage").text(error).addClass("alert alert-danger");
inputField.parent().addClass('error');
}
}
} else {
console.log(errorThrown);
console.log(jqXHR);
$('#messagesPanel div').text(errorThrown).parent().show();
}
statusCode: {
201: onSuccess,
400: onError,
default: onError
}
});
event.preventDefault();