///#source 1 1 Disco-ExpressionEditor/disco.expressioneditor.js
///
'; if (lineSrc.length >= exception.PositionColumn) { line += lineSrc.substr(0, exception.PositionColumn - 1); line += '' + lineSrc.substr(exception.PositionColumn - 1, 1) + ''; line += lineSrc.substr(exception.PositionColumn); } else { line += lineSrc; line += ' '; } line += '
'; expressionLines[i] = line; } else { expressionLines[i] = '' + expressionLines[i].trim() + '
'; } } return expressionLines.join(''); }, setExpression: function (expression) { this.expression = expression; this.setException(null); this.renderExpression(); }, getExpression: function () { var e = null; $('p', this.hostContainer).each(function () { if (e == null) e = $(this).text(); else e += '\n' + $(this).text(); }); this.expression = e; return e; }, setException: function (exception) { if (this.expressionException !== exception) { this.expressionException = exception; if (this.expressionExceptionChanged) this.expressionExceptionChanged(exception); } }, renderExpression: function () { this.expressionHtml = this.parseExpression(this.expression, this.expressionException); this.hostContainer.html(this.expressionHtml); }, validateExpression: function () { var that = this; var e = that.getExpression(); $.getJSON(that.validateUrl, { Expression: e }, function (response, result) { that.setException(response); that.renderExpression(); if (that.expressionValidated) that.expressionValidated(response.ExpressionValid, response); }) } } String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ""); }