Merge pull request #909 from fluf1024/post-scripts
Allow longer expressions by sendig them as POST
This commit is contained in:
commit
cf3cf5d681
@ -158,8 +158,8 @@ ExpressionPreviewDialog.Widget.prototype.getExpression = function(commit) {
|
|||||||
s = this._getLanguage() + ":" + s;
|
s = this._getLanguage() + ":" + s;
|
||||||
if (commit) {
|
if (commit) {
|
||||||
$.post(
|
$.post(
|
||||||
"command/core/log-expression?" + $.param({ project: theProject.id, expression: s }),
|
"command/core/log-expression?" + $.param({ project: theProject.id }),
|
||||||
null,
|
{ expression: s },
|
||||||
function(data) {
|
function(data) {
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
@ -390,7 +390,6 @@ ExpressionPreviewDialog.Widget.prototype.update = function() {
|
|||||||
var expression = this.expression = $.trim(this._elmts.expressionPreviewTextarea[0].value);
|
var expression = this.expression = $.trim(this._elmts.expressionPreviewTextarea[0].value);
|
||||||
var params = {
|
var params = {
|
||||||
project: theProject.id,
|
project: theProject.id,
|
||||||
expression: this._getLanguage() + ":" + expression,
|
|
||||||
cellIndex: this._cellIndex
|
cellIndex: this._cellIndex
|
||||||
};
|
};
|
||||||
this._prepareUpdate(params);
|
this._prepareUpdate(params);
|
||||||
@ -398,6 +397,7 @@ ExpressionPreviewDialog.Widget.prototype.update = function() {
|
|||||||
$.post(
|
$.post(
|
||||||
"command/core/preview-expression?" + $.param(params),
|
"command/core/preview-expression?" + $.param(params),
|
||||||
{
|
{
|
||||||
|
expression: this._getLanguage() + ":" + expression,
|
||||||
rowIndices: JSON.stringify(this._rowIndices)
|
rowIndices: JSON.stringify(this._rowIndices)
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
@ -421,10 +421,12 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
|
|||||||
var table = $('<table></table>').appendTo(
|
var table = $('<table></table>').appendTo(
|
||||||
$('<div>').addClass("expression-preview-table-wrapper").appendTo(container))[0];
|
$('<div>').addClass("expression-preview-table-wrapper").appendTo(container))[0];
|
||||||
|
|
||||||
|
var truncExpression = expression.length > 30 ? expression.substring(0, 30) + ' ...' : expression;
|
||||||
|
|
||||||
var tr = table.insertRow(0);
|
var tr = table.insertRow(0);
|
||||||
$(tr.insertCell(0)).addClass("expression-preview-heading").text("row");
|
$(tr.insertCell(0)).addClass("expression-preview-heading").text("row");
|
||||||
$(tr.insertCell(1)).addClass("expression-preview-heading").text("value");
|
$(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) {
|
var renderValue = function(td, v) {
|
||||||
if (v !== null && v !== undefined) {
|
if (v !== null && v !== undefined) {
|
||||||
|
@ -96,10 +96,13 @@ ProcessPanel.prototype.showUndo = function(historyEntry) {
|
|||||||
|
|
||||||
this._latestHistoryEntry = historyEntry;
|
this._latestHistoryEntry = historyEntry;
|
||||||
|
|
||||||
|
truncDescription = historyEntry.description.length > 250 ?
|
||||||
|
historyEntry.description.substring(0, 250) + " ..." : historyEntry.description
|
||||||
|
|
||||||
this._div.stop(true, false);
|
this._div.stop(true, false);
|
||||||
this._elmts.progressDiv.hide();
|
this._elmts.progressDiv.hide();
|
||||||
this._elmts.undoDiv.show();
|
this._elmts.undoDiv.show();
|
||||||
this._elmts.undoDescription.text(historyEntry.description);
|
this._elmts.undoDescription.text( truncDescription );
|
||||||
this._elmts.undoLink.unbind().click(function() { self.undo(); });
|
this._elmts.undoLink.unbind().click(function() { self.undo(); });
|
||||||
|
|
||||||
this._div
|
this._div
|
||||||
|
@ -36,13 +36,12 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
|
|||||||
Refine.postCoreProcess(
|
Refine.postCoreProcess(
|
||||||
"text-transform",
|
"text-transform",
|
||||||
{
|
{
|
||||||
columnName: column.name,
|
columnName: column.name,
|
||||||
expression: expression,
|
|
||||||
onError: onError,
|
onError: onError,
|
||||||
repeat: repeat,
|
repeat: repeat,
|
||||||
repeatCount: repeatCount
|
repeatCount: repeatCount
|
||||||
},
|
},
|
||||||
null,
|
{ expression: expression },
|
||||||
{ cellsChanged: true }
|
{ cellsChanged: true }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -72,13 +72,12 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
|
|||||||
Refine.postCoreProcess(
|
Refine.postCoreProcess(
|
||||||
"add-column",
|
"add-column",
|
||||||
{
|
{
|
||||||
baseColumnName: column.name,
|
baseColumnName: column.name,
|
||||||
expression: previewWidget.getExpression(true),
|
|
||||||
newColumnName: columnName,
|
newColumnName: columnName,
|
||||||
columnInsertIndex: columnIndex + 1,
|
columnInsertIndex: columnIndex + 1,
|
||||||
onError: $('input[name="create-column-dialog-onerror-choice"]:checked')[0].value
|
onError: $('input[name="create-column-dialog-onerror-choice"]:checked')[0].value
|
||||||
},
|
},
|
||||||
null,
|
{ expression: previewWidget.getExpression(true) },
|
||||||
{ modelsChanged: true },
|
{ modelsChanged: true },
|
||||||
{
|
{
|
||||||
onDone: function(o) {
|
onDone: function(o) {
|
||||||
|
Loading…
Reference in New Issue
Block a user