diff --git a/main/webapp/modules/core/scripts/views/data-table/add-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/add-column-dialog.html new file mode 100644 index 000000000..10582d206 --- /dev/null +++ b/main/webapp/modules/core/scripts/views/data-table/add-column-dialog.html @@ -0,0 +1,20 @@ +
+
+
+
+ + + + + + + + + +
New column name
On error set to blank store error keep original
$EXPRESSION_PREVIEW_WIDGET$
+
+ +
\ No newline at end of file diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-editor.html b/main/webapp/modules/core/scripts/views/data-table/cell-editor.html new file mode 100644 index 000000000..5d84e3402 --- /dev/null +++ b/main/webapp/modules/core/scripts/views/data-table/cell-editor.html @@ -0,0 +1,17 @@ + + + ' + - '' + - '' + - '' + - '' + - '
' + - '
' + - 'List of integers separated by commas, e.g., 5, 7, 15' + - '
' + - '' + - '' + - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '

After Splitting

Guess cell type
Remove this column
' + - '' + - '' - ); - var bodyElmts = DOM.bind(body); - - footer.html( - '' + - '' - ); - var footerElmts = DOM.bind(footer); - var level = DialogSystem.showDialog(frame); - var dismiss = function() { - DialogSystem.dismissUntil(level - 1); - }; + var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - footerElmts.okButton.click(function() { + elmts.cancelButton.click(dismiss); + elmts.okButton.click(function() { var mode = $("input[name='split-by-mode']:checked")[0].value; var config = { columnName: self._column.name, mode: mode, - guessCellType: bodyElmts.guessCellTypeInput[0].checked, - removeOriginalColumn: bodyElmts.removeColumnInput[0].checked + guessCellType: elmts.guessCellTypeInput[0].checked, + removeOriginalColumn: elmts.removeColumnInput[0].checked }; if (mode == "separator") { - config.separator = bodyElmts.separatorInput[0].value; + config.separator = elmts.separatorInput[0].value; if (!(config.separator)) { alert("Please specify a separator."); return; } - config.regex = bodyElmts.regexInput[0].checked; + config.regex = elmts.regexInput[0].checked; - var s = bodyElmts.maxColumnsInput[0].value; + var s = elmts.maxColumnsInput[0].value; if (s) { var n = parseInt(s,10); if (!isNaN(n)) { @@ -1137,7 +990,7 @@ DataTableColumnHeaderUI.prototype._doSplitColumn = function() { } } } else { - var s = "[" + bodyElmts.lengthsTextarea[0].value + "]"; + var s = "[" + elmts.lengthsTextarea[0].value + "]"; try { var a = JSON.parse(s); } catch (e) { @@ -1164,8 +1017,6 @@ DataTableColumnHeaderUI.prototype._doSplitColumn = function() { ); dismiss(); }); - - footerElmts.cancelButton.click(dismiss); }; DataTableColumnHeaderUI.prototype._doTransposeColumnsIntoRows = function() { @@ -1264,8 +1115,6 @@ DataTableColumnHeaderUI.prototype._doTransposeRowsIntoColumns = function() { }; DataTableColumnHeaderUI.prototype._showSortingCriterion = function(criterion, hasOtherCriteria) { - var self = this; - criterion = criterion || { column: this._column.name, valueType: "string", @@ -1274,61 +1123,19 @@ DataTableColumnHeaderUI.prototype._showSortingCriterion = function(criterion, ha blankPosition: 2 }; - var frame = DialogSystem.createDialog(); - frame.width("400px"); + var self = this; + var frame = $(DOM.loadHTML("core", "scripts/views/data-table/sorting-criterion-dialog.html")); + var elmts = DOM.bind(frame); - var header = $('
').addClass("dialog-header").text("Sort by " + this._column.name).appendTo(frame); - var body = $('
').addClass("dialog-body").appendTo(frame); - var footer = $('
').addClass("dialog-footer").appendTo(frame); + elmts.dialogHeader.text('Sort by ' + this._column.name); - body.html( - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
Sort cell values asPosition blanks and errors
' + - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
text case-sensitive
numbers
dates
booleans
' + - '
' + - '
    ' + - '

    Drag and drop to re-order

    ' + - '
    ' + - ' ' + - ' ' + - '' + - '
    ' - ); - - var bodyElmts = DOM.bind(body); - - bodyElmts.valueTypeOptions.find("input[type='radio'][value='" + criterion.valueType + "']") + elmts.valueTypeOptions + .find("input[type='radio'][value='" + criterion.valueType + "']") .attr("checked", "checked"); var setValueType = function(valueType) { - var forward = $("#sorting-dialog-direction-forward"); - var reverse = $("#sorting-dialog-direction-reverse"); + var forward = elmts.directionForwardLabel; + var reverse = elmts.directionReverseLabel; if (valueType == "string") { forward.html("a - z"); reverse.html("z - a"); @@ -1343,19 +1150,22 @@ DataTableColumnHeaderUI.prototype._showSortingCriterion = function(criterion, ha reverse.html("true then false"); } }; - bodyElmts.valueTypeOptions.find("input[type='radio']").change(function() { - setValueType(this.value); - }); + elmts.valueTypeOptions + .find("input[type='radio']") + .change(function() { + setValueType(this.value); + }); if (criterion.valueType == "string" && criterion.caseSensitive) { - bodyElmts.caseSensitiveCheckbox.attr("checked", "checked"); + elmts.caseSensitiveCheckbox.attr("checked", "checked"); } - bodyElmts.directionOptions.find("input[type='radio'][value='" + (criterion.reverse ? "reverse" : "forward") + "']") + elmts.directionOptions + .find("input[type='radio'][value='" + (criterion.reverse ? "reverse" : "forward") + "']") .attr("checked", "checked"); if (hasOtherCriteria) { - bodyElmts.sortAloneContainer.show(); + elmts.sortAloneContainer.show(); } var validValuesHtml = '
  • Valid Values
  • '; @@ -1379,31 +1189,23 @@ DataTableColumnHeaderUI.prototype._showSortingCriterion = function(criterion, ha positionsHtml = [ validValuesHtml, blankValuesHtml, errorValuesHtml ]; } } - bodyElmts.blankErrorPositions.html(positionsHtml.join("")).sortable().disableSelection(); + elmts.blankErrorPositions.html(positionsHtml.join("")).sortable().disableSelection(); - footer.html( - '' + - '' - ); - var footerElmts = DOM.bind(footer); - var level = DialogSystem.showDialog(frame); - var dismiss = function() { - DialogSystem.dismissUntil(level - 1); - }; + var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; setValueType(criterion.valueType); - footerElmts.cancelButton.click(dismiss); - footerElmts.okButton.click(function() { + elmts.cancelButton.click(dismiss); + elmts.okButton.click(function() { var criterion2 = { column: self._column.name, - valueType: bodyElmts.valueTypeOptions.find("input[type='radio']:checked")[0].value, - reverse: bodyElmts.directionOptions.find("input[type='radio']:checked")[0].value == "reverse" + valueType: elmts.valueTypeOptions.find("input[type='radio']:checked")[0].value, + reverse: elmts.directionOptions.find("input[type='radio']:checked")[0].value == "reverse" }; var valuePosition, blankPosition, errorPosition; - bodyElmts.blankErrorPositions.find("li").each(function(index, elmt) { + elmts.blankErrorPositions.find("li").each(function(index, elmt) { var kind = this.getAttribute("kind"); if (kind == "value") { valuePosition = index; @@ -1417,11 +1219,11 @@ DataTableColumnHeaderUI.prototype._showSortingCriterion = function(criterion, ha criterion2.errorPosition = errorPosition - valuePosition; if (criterion2.valueType == "string") { - criterion2.caseSensitive = bodyElmts.caseSensitiveCheckbox[0].checked; + criterion2.caseSensitive = elmts.caseSensitiveCheckbox[0].checked; } self._dataTableView._addSortingCriterion( - criterion2, bodyElmts.sortAloneContainer.find("input")[0].checked); + criterion2, elmts.sortAloneContainer.find("input")[0].checked); dismiss(); }); diff --git a/main/webapp/modules/core/scripts/views/data-table/sorting-criterion-dialog.html b/main/webapp/modules/core/scripts/views/data-table/sorting-criterion-dialog.html new file mode 100644 index 000000000..8c3d4936d --- /dev/null +++ b/main/webapp/modules/core/scripts/views/data-table/sorting-criterion-dialog.html @@ -0,0 +1,46 @@ +
    +
    +
    +
    + + + + + + + + + +
    Sort cell values asPosition blanks and errors
    +
    + + + + + + + + + + + + + + + + +
    text case-sensitive
    numbers
    dates
    booleans
    +
    +
      +

      Drag and drop to re-order

      +
      + + + +
      +
      + +
      \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html new file mode 100644 index 000000000..6591849f3 --- /dev/null +++ b/main/webapp/modules/core/scripts/views/data-table/split-column-dialog.html @@ -0,0 +1,55 @@ +
      +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      How to Split Column

      by separator
      Separator regular expression
      Split into columns at most (leave blank for no limit)
      by field lengths
      List of integers separated by commas, e.g., 5, 7, 15
      +
      +
      + + + + + + + + + + + +

      After Splitting

      Guess cell type
      Remove this column
      +
      +
      + +
      \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/views/data-table/text-transform-dialog.html b/main/webapp/modules/core/scripts/views/data-table/text-transform-dialog.html new file mode 100644 index 000000000..313299d40 --- /dev/null +++ b/main/webapp/modules/core/scripts/views/data-table/text-transform-dialog.html @@ -0,0 +1,18 @@ +
      +
      +
      +
      + + + + + + + +
      $EXPRESSION_PREVIEW_WIDGET$
      On error set to blank
      store error
      keep original
      Re-transform until no change
      up to times
      +
      + +
      \ No newline at end of file