More resources translated ...

This commit is contained in:
Paulo Gustavo Veiga
2012-06-30 15:25:24 -03:00
parent 7b6293dc46
commit cc9f57a153
9 changed files with 113 additions and 155 deletions

View File

@@ -42,7 +42,7 @@
</c:if>
<div class="form-inline">
<button class="btn btn-primary" data-loading-text="<spring:message code="SIGN_IN"/> ...">
<button class="btn btn-primary" data-loading-text="<spring:message code="SIGN_ING"/>">
<spring:message code="SIGN_IN"/></button>
&nbsp;&nbsp;&nbsp;
<input type="checkbox" id="rememberme" name="_spring_security_remember_me"/>

View File

@@ -28,30 +28,34 @@
var tableElem = $('#historyTable');
jQuery.ajax("service/maps/${mindmapId}/history", {
async:false,
dataType: 'json',
type: 'GET',
dataType:'json',
type:'GET',
contentType:"text/plain",
success : function(data, textStatus, jqXHR) {
$(data.changes).each(function() {
tableElem.append('\
success:function (data, textStatus, jqXHR) {
if (data.changes.length > 0) {
$(data.changes).each(function () {
tableElem.append('\
<tr data-history-id="' + this.id + '">\
<td>' + this.creator + '</td>\
<td><abbr class="timeago" title="' + this.creationTime + '">' + jQuery.timeago(this.creationTime) + '</abbr></td>\
<td><a class="view" href="#">view</a></td>\
<td><a class="revert" href="#">revert</a></td>\
</tr>');
});
});
} else {
$('#historyContainer').text("<spring:message code="NO_HISTORY_RESULTS"/>");
}
tableElem.find('tr a.view').each(function() {
$(this).click(function(event) {
tableElem.find('tr a.view').each(function () {
$(this).click(function (event) {
window.open("/c/maps/${mindmapId}/" + $(this).closest("tr").attr("data-history-id") + "/view");
event.preventDefault();
});
});
tableElem.find('tr a.revert').each(function() {
$(this).click(function(event) {
tableElem.find('tr a.revert').each(function () {
$(this).click(function (event) {
var url = "service/maps/${mindmapId}/history/" + $(this).closest("tr").attr("data-history-id");
jQuery.post(url, function(data) {
jQuery.post(url, function (data) {
window.parent.location = "c/maps/${mindmapId}/edit";
});
event.preventDefault();
@@ -59,8 +63,8 @@
});
},
error:function(jqXHR, textStatus, errorThrown) {
alert(textStatus);
error:function (jqXHR, textStatus, errorThrown) {
console.log(textStatus);
}
});
</script>

View File

@@ -35,11 +35,11 @@
var contentType = null;
var fileContent = null;
$('#cancelButton').click(function() {
$('#cancelButton').click(function () {
window.location = '/c/maps/';
});
$('#dialogMainForm').submit(function(event) {
$('#dialogMainForm').submit(function (event) {
// Load form parameters ...
var title = $('#dialogMainForm #title').attr('value');
title = title == undefined ? "" : title;
@@ -51,15 +51,15 @@
jQuery.ajax("service/maps?title=" + encodeURI(title) + "&description=" + encodeURI(description),
{
async:false,
data: fileContent,
type: 'POST',
dataType: 'json',
data:fileContent,
type:'POST',
dataType:'json',
contentType:contentType,
success : function(data, textStatus, jqXHR) {
success:function (data, textStatus, jqXHR) {
var resourceId = jqXHR.getResponseHeader("ResourceId");
window.location = "c/maps/" + resourceId + "/edit";
},
error: function(jqXHR, textStatus, errorThrown) {
error:function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 400) {
var errors = JSON.parse(jqXHR.responseText);
// Mark fields with errors ...
@@ -91,7 +91,7 @@
event.preventDefault();
});
$('#dialogMainForm #mapFile').change(function(event) {
$('#dialogMainForm #mapFile').change(function (event) {
var file = event.target.files[0];
var reader = new FileReader();
@@ -100,7 +100,7 @@
$('#dialogMainForm #title').attr('value', jQuery.camelCase(title));
// Closure to capture the file information.
reader.onload = (function(event) {
reader.onload = (function (event) {
fileContent = event.target.result;
contentType = file.name.lastIndexOf(".wxml") != -1 ? "application/xml" : "application/freemind";
});
@@ -110,7 +110,7 @@
});
// Hook for interaction with the main parent window ...
var submitDialogForm = function() {
var submitDialogForm = function () {
$('#dialogMainForm').submit();
}

View File

@@ -61,7 +61,7 @@
}
},
{
sTitle:"Creator",
sTitle:"<spring:message code="CREATOR"/>",
mDataProp:"creator"
},
{
@@ -181,8 +181,9 @@
</li>
<li id="shareBtn"><a href="#" onclick="return false"><i class="icon-share"></i> <spring:message
code="SHARE"/></a></li>
<li id="exportBtn"><a href="#" onclick="return false"><i class="icon-download"></i> <spring:message
code="EXPORT"/></a>
<li id="exportBtn"><a href="#" onclick="return false"><i class="icon-download"></i>
<spring:message
code="EXPORT"/></a>
</li>
<li id="printBtn"><a href="#" onclick="return false"><i class="icon-print"></i> <spring:message
code="PRINT"/></a></li>
@@ -278,8 +279,7 @@
<div id="rename-dialog-modal" class="modal fade">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3 id="renameDialogTitle"><spring:message
code="RENAME"/></h3>
<h3 id="renameDialogTitle"><spring:message code="RENAME"/></h3>
</div>
<div class="modal-body">
<div class="errorMessage"></div>

View File

@@ -119,7 +119,7 @@
<div id="zoomOut" class="button"></div>
<div id="mapDetails">
<span class="title"><spring:message code="CREATOR"/>:</span><span>${mindmap.creator.username}</span>
<span class="title"><spring:message code="CREATOR"/>:</span><span>${mindmap.creator.fullName}</span>
<span class="title"><spring:message code="DESCRIPTION"/>:</span><span>${mindmap.title}</span>
</div>
</div>

View File

@@ -10,7 +10,7 @@
</style>
<form method="post" id="dialogMainForm" action="#" class="well form-inline">
<label for="enablePublicView" class="control-label">Enable Sharing:
<label for="enablePublicView" class="control-label"><spring:message code="ENABLE_PUBLISHING"/>:
<input type="checkbox" id="enablePublicView" name="publicView"
<c:if test="${mindmap.public}">
checked="checked"
@@ -18,13 +18,14 @@
</label>
</form>
<p><span class="label label-important">Warning</span> <spring:message code="PUBLISH_DETAILS"/></p>
<p><span class="label label-important"> <spring:message code="WARNING"/></span> <spring:message code="PUBLISH_DETAILS"/>
</p>
<div id="publishPanel">
<ul class="nav nav-tabs">
<li class="active"><a href="#embedTab" data-toggle="pill">Embed</a></li>
<li><a href="#publicUrlTab" data-toggle="pill">Public URLs</a></li>
<li class="active"><a href="#embedTab" data-toggle="pill"><spring:message code="EMBED"/></a></li>
<li><a href="#publicUrlTab" data-toggle="pill"><spring:message code="PUBLIC_URL"/></a></li>
</ul>
<div class="tab-content">
@@ -32,17 +33,15 @@
<spring:message code="BLOG_INCLUSION"/>
<div id="wizardContainer">
<form class="form-inline" action="#">
<label for="frameWith">Frame width:</label>
<input type="number" id="frameWith" name="frameWith" value="600" class="span2"
min="0"/>
<label for="frameWidth"><spring:message code="FRAME_WIDTH"/>:</label>
<input type="number" id="frameWidth" name="frameWidth" value="600" class="span2" min="0"/>
<label for="frameHeight">Frame height:</label>
<label for="frameHeight"><spring:message code="FRAME_HEIGHT"/>:</label>
<input type="number" id="frameHeight" name="frameHeight" value="400" class="span2" min="0"/>
<label for="mapZoom">Zoom %:</label>
<input type="number" id="mapZoom"
name="mapZoom" value="80"
class="span2" min="10" max="200" step="10"/>
<label for="mapZoom"><spring:message code="ZOOM"/> %:</label>
<input type="number" id="mapZoom" name="mapZoom" value="80" class="span2" min="10" max="200"
step="10"/>
</form>
</div>
<label><spring:message code="BLOG_SNIPPET"/></label>
@@ -62,7 +61,7 @@ solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"&gt; &lt;/iframe&
<script type="text/javascript">
// Update tabs display status ...
var checkboxElems = $('#dialogMainForm input:checkbox');
var updateTabsDisplay = function() {
var updateTabsDisplay = function () {
var divElem = $('#publishPanel');
checkboxElems[0].checked ? divElem.show() : divElem.hide();
};
@@ -70,7 +69,7 @@ solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"&gt; &lt;/iframe&
updateTabsDisplay();
// Change snippet code based on the user options ...
var replaceCode = function(regExpr, strReplace, factor) {
var replaceCode = function (regExpr, strReplace, factor) {
var preElem = $('#publishPanel #embedCode')[0];
var fieldValue = this.value;
if (!isNaN(fieldValue) && fieldValue.length > 0) {
@@ -79,43 +78,43 @@ solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"&gt; &lt;/iframe&
}
};
$('#publishPanel #frameWith').keyup(function() {
$('#publishPanel #frameWidth').keyup(function () {
replaceCode.bind(this)(/width:[0-9]+px/g, "width:%spx", 1);
});
$('#publishPanel #frameWith').change(function() {
$('#publishPanel #frameWidth').change(function () {
replaceCode.bind(this)(/width:[0-9]+px/g, "width:%spx", 1);
});
$('#publishPanel #frameHeight').keyup(function() {
$('#publishPanel #frameHeight').keyup(function () {
replaceCode.bind(this)(/height:[0-9]+px/g, "height:%spx", 1);
});
$('#publishPanel #frameHeight').change(function() {
$('#publishPanel #frameHeight').change(function () {
replaceCode.bind(this)(/height:[0-9]+px/g, "height:%spx", 1);
});
$('#publishPanel #mapZoom').keyup(function() {
$('#publishPanel #mapZoom').keyup(function () {
replaceCode.bind(this)(/zoom=.+\"/g, "zoom=%s\"", 0.1);
});
$('#publishPanel #mapZoom').change(function() {
$('#publishPanel #mapZoom').change(function () {
replaceCode.bind(this)(/zoom=.+\"/g, "zoom=%s\"", 0.01);
});
// Save status on click ...
$('#dialogMainForm').submit(function(event) {
$('#dialogMainForm').submit(function (event) {
jQuery.ajax("service/maps/${mindmap.id}/publish", {
async:false,
dataType: 'json',
data: $('#dialogMainForm #enablePublicView')[0].checked ? 'true' : 'false',
type: 'PUT',
dataType:'json',
data:$('#dialogMainForm #enablePublicView')[0].checked ? 'true' : 'false',
type:'PUT',
contentType:"text/plain",
success : function(data, textStatus, jqXHR) {
success:function (data, textStatus, jqXHR) {
$('#publish-dialog-modal').modal('hide');
},
error: function(jqXHR, textStatus, errorThrown) {
error:function (jqXHR, textStatus, errorThrown) {
alert(textStatus);
}
});
@@ -123,7 +122,7 @@ solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"&gt; &lt;/iframe&
});
// Hook for interaction with the main parent window ...
var submitDialogForm = function() {
var submitDialogForm = function () {
$('#dialogMainForm').submit();
}
</script>

View File

@@ -39,7 +39,7 @@
</style>
<p><strong>Who has access:</strong></p>
<p><strong><spring:message code="WHO_CAN_ACCESS"/>:</strong></p>
<div id="sharingContainer">
<table class="table" id="collabsTable">
@@ -55,25 +55,25 @@
<div id="errorMsg" class="alert alert-error"></div>
<div>
<p><strong>Add People:</strong></p>
<p><strong><spring:message code="ADD_PEOPLE"/>:</strong></p>
<input type="text" id="collabEmails" name="collabEmails"
placeholder="Enter collaborators emails separared by comas." class="span1"/>
placeholder="<spring:message code="COLLABORATORS_SEPARATED_BY_COMA"/>" class="span1"/>
<div class="btn-group" id="roleBtn">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Can edit
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="CAN_EDIT"/>
<span class="caret"> </span>
</a>
<ul class="dropdown-menu" data-role="editor" id="shareRole">
<li><a href="#" data-role="editor">Can edit</a></li>
<li><a href="#" data-role="viewer">Can view</a></li>
<li><a href="#" data-role="editor"><spring:message code="CAN_EDIT"/></a></li>
<li><a href="#" data-role="viewer"><spring:message code="CAN_VIEW"/></a></li>
</ul>
</div>
<button id="addBtn" class="btn btn-primary">Add</button>
<button id="addBtn" class="btn btn-primary"><spring:message code="ADD"/></button>
</div>
<div style="margin-top: 10px;">
<p><strong>Notify people via email</strong> - <a href="#" id="addMessageLink">Add message</a></p>
<textarea cols="4" id="collabMessage" placeholder="Optional: Include a personal message">
<p><strong><spring:message code="EMAIL_NOTIFICATION_MESSAGE"/></strong> - <a href="#" id="addMessageLink"><spring:message code="ADD_MESSAGE"/></a></p>
<textarea cols="4" id="collabMessage" placeholder="<spring:message code="OPTIONAL_CUSTOM_MESSAGE"/>">
</textarea>
</div>
@@ -91,9 +91,9 @@ $("#addMessageLink").click(function(event) {
});
var messages = {
owner: 'Is owner',
editor: 'Can edit',
viewer: 'Can view'};
owner: '<spring:message code="IS_OWNER"/>',
editor: '<spring:message code="CAN_EDIT"/>',
viewer: '<spring:message code="CAN_VIEW"/>'};
function onClickShare(aElem) {
var role = $(aElem).attr('data-role');