Allow longer expressions by sendig them as POST

This commit is contained in:
Jan Mayer 2014-11-11 11:41:55 +01:00
parent c15f8d1ffd
commit 00dc954336
4 changed files with 14 additions and 11 deletions

View File

@ -158,8 +158,8 @@ ExpressionPreviewDialog.Widget.prototype.getExpression = function(commit) {
s = this._getLanguage() + ":" + s;
if (commit) {
$.post(
"command/core/log-expression?" + $.param({ project: theProject.id, expression: s }),
null,
"command/core/log-expression?" + $.param({ project: theProject.id }),
{ expression: s },
function(data) {
},
"json"
@ -390,7 +390,6 @@ ExpressionPreviewDialog.Widget.prototype.update = function() {
var expression = this.expression = $.trim(this._elmts.expressionPreviewTextarea[0].value);
var params = {
project: theProject.id,
expression: this._getLanguage() + ":" + expression,
cellIndex: this._cellIndex
};
this._prepareUpdate(params);
@ -398,6 +397,7 @@ ExpressionPreviewDialog.Widget.prototype.update = function() {
$.post(
"command/core/preview-expression?" + $.param(params),
{
expression: this._getLanguage() + ":" + expression,
rowIndices: JSON.stringify(this._rowIndices)
},
function(data) {
@ -421,10 +421,12 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
var table = $('<table></table>').appendTo(
$('<div>').addClass("expression-preview-table-wrapper").appendTo(container))[0];
var truncExpression = expression.length > 30 ? expression.substring(0, 30) + ' ...' : expression;
var tr = table.insertRow(0);
$(tr.insertCell(0)).addClass("expression-preview-heading").text("row");
$(tr.insertCell(1)).addClass("expression-preview-heading").text("value");
$(tr.insertCell(2)).addClass("expression-preview-heading").text(expression);
$(tr.insertCell(2)).addClass("expression-preview-heading").text(truncExpression);
var renderValue = function(td, v) {
if (v !== null && v !== undefined) {

View File

@ -96,10 +96,13 @@ ProcessPanel.prototype.showUndo = function(historyEntry) {
this._latestHistoryEntry = historyEntry;
truncDescription = historyEntry.description.length > 250 ?
historyEntry.description.substring(0, 250) + " ..." : historyEntry.description
this._div.stop(true, false);
this._elmts.progressDiv.hide();
this._elmts.undoDiv.show();
this._elmts.undoDescription.text(historyEntry.description);
this._elmts.undoDescription.text( truncDescription );
this._elmts.undoLink.unbind().click(function() { self.undo(); });
this._div

View File

@ -37,12 +37,11 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
"text-transform",
{
columnName: column.name,
expression: expression,
onError: onError,
repeat: repeat,
repeatCount: repeatCount
},
null,
{ expression: expression },
{ cellsChanged: true }
);
};

View File

@ -73,12 +73,11 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
"add-column",
{
baseColumnName: column.name,
expression: previewWidget.getExpression(true),
newColumnName: columnName,
columnInsertIndex: columnIndex + 1,
onError: $('input[name="create-column-dialog-onerror-choice"]:checked')[0].value
},
null,
{ expression: previewWidget.getExpression(true) },
{ modelsChanged: true },
{
onDone: function(o) {