diff --git a/libraries.txt b/libraries.txt
index 7e0bd5b7..a8c634c8 100644
--- a/libraries.txt
+++ b/libraries.txt
@@ -31,6 +31,6 @@ dropzone 4e20bd4 MIT https://github.com/enyo/dropzone
Filemanager 7e060c2 MIT https://github.com/simogeo/Filemanager
Unit (Length) d8e6237 MIT https://github.com/heygrady/Units/blob/master/Length.min.js
Natural Sort 9565816 MIT https://github.com/javve/natural-sort/blob/master/index.js
-SlickGrid 2.2.4 MIT https://github.com/6pac/SlickGrid
+SlickGrid 2.3.6-53ee34 MIT https://github.com/6pac/SlickGrid
jQuery-UI 1.11.3 MIT https://jqueryui.com/
BigNumber 3.0.1 MIT http://mikemcl.github.io/bignumber.js
\ No newline at end of file
diff --git a/web/pgadmin/static/vendor/slickgrid/README b/web/pgadmin/static/vendor/slickgrid/README
deleted file mode 100644
index cf583515..00000000
--- a/web/pgadmin/static/vendor/slickgrid/README
+++ /dev/null
@@ -1,9 +0,0 @@
-WARNING!!
-
-The following changes have been made to SlickGrid. These must be re-applied if updating the code from upstream!
-
-- The CSS class 'slick-row' has been renamed to 'sr'
-
-- The CSS class 'slick-cell' has been renamed to 'sc'
-
-The intent of these changes is to minimise memory usage by the grid, by saving a few bytes per row/cell.
\ No newline at end of file
diff --git a/web/pgadmin/static/vendor/slickgrid/README.md b/web/pgadmin/static/vendor/slickgrid/README.md
new file mode 100644
index 00000000..e8a1ad7a
--- /dev/null
+++ b/web/pgadmin/static/vendor/slickgrid/README.md
@@ -0,0 +1,9 @@
+## This is the 6pac SlickGrid repo
+
+This is the acknowledged most active non-customised fork of SlickGrid.
+
+It aims to be a viable alternative master repo, building on the legacy of the mleibman/SlickGrid master branch, keeping libraries up to date and applying small, safe core patches and enhancements without turning into a personalised build.
+
+Check out the [examples](https://github.com/6pac/SlickGrid/wiki/Examples) for examples demonstrating new features and use cases, such as dynamic grid creation and editors with third party controls.
+
+Also check out the [wiki](https://github.com/6pac/SlickGrid/wiki) for news and documentation.
\ No newline at end of file
diff --git a/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js b/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js
index dc167209..93a6be5b 100644
--- a/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js
+++ b/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js
@@ -12,12 +12,12 @@
grid.onColumnsReordered.subscribe(updateColumnOrder);
options = $.extend({}, defaults, options);
- $menu = $("").appendTo(document.body);
+ $menu = $("").appendTo(document.body);
- $menu.bind("mouseleave", function (e) {
+ $menu.on("mouseleave", function (e) {
$(this).fadeOut(options.fadeSpeed)
});
- $menu.bind("click", updateColumn);
+ $menu.on("click", updateColumn);
}
@@ -44,7 +44,7 @@
}
$("")
- .text(columns[i].name)
+ .html(columns[i].name)
.prepend($input)
.appendTo($li);
}
@@ -73,6 +73,7 @@
$menu
.css("top", e.pageY - 10)
.css("left", e.pageX - 10)
+ .css("max-height", $(window).height() - e.pageY -10)
.fadeIn(options.fadeSpeed);
}
diff --git a/web/pgadmin/static/vendor/slickgrid/images/CheckboxN.png b/web/pgadmin/static/vendor/slickgrid/images/CheckboxN.png
new file mode 100644
index 0000000000000000000000000000000000000000..072ecbb96435c4822374cb3116fca5819194363e
GIT binary patch
literal 257
zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1SBVD?P>#3Ea{HEjtmSN`?>!lvI6;>1s;*b
zKsARzm{C;2s{tq|S>hT|5}cn_Ql40p%21G)nOCBhms+A=qGzCIXynY2{RXJ0&eO#)
zL?ig>B}2Xz1rgW4@B8_c0=zQP7!PQ@;Yl%a_HX5{m2JFHW&PiNA;a`vJKVfA?^S2N
zz1F(0n6E)ZujPY$i>}E^!)NBa4I$aJKFkWDPH!$V#Cc2&n!`IOXj0uei+8)WFEMnh
wdGKZ{w|Q5nSEq>ooZ^3chi-4HUvN!$+qFOEue>{c3+NICPgg&ebxsLQ07+L^=>Px#
literal 0
HcmV?d00001
diff --git a/web/pgadmin/static/vendor/slickgrid/images/CheckboxY.png b/web/pgadmin/static/vendor/slickgrid/images/CheckboxY.png
new file mode 100644
index 0000000000000000000000000000000000000000..467f3010896f438d0ede54760ba1aec7da3161ed
GIT binary patch
literal 361
zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1SBVD?P>#3Ea{HEjtmSN`?>!lvI6;>1s;*b
zKsARzm{C;2s{tq|S>hT|5}cn_Ql40p%21G)nOCBhms+A=qGzCIXynY2{RXJ$nWu|m
zh(>VlC4KH@2Z`e!_ijrR$!YSOoUkox>o2Votq8Sgs*|O7*k*4qo3iny@4M%B4{y7j
zyCGlT{m%ZT`m)#eb4wzp?ONBp$igczB2<(iaL2ODclL+$OfK4-&kxGIeQR5<@;Szi
zWtmli(rpI~cw7Tbd|&V4Yse6BO*cGV_-%~=&qfx3jQijBy?-ph!dSlU^(JmtuEa>O
zZKbi#&zbo0>cmFk()-t50omKnUdI%IO44$rjF6*2UngHN5
BjpYCU
literal 0
HcmV?d00001
diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js
index 6633bb70..ffa93e0d 100644
--- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js
+++ b/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js
@@ -21,7 +21,7 @@
enableForHeaderCells: false,
maxToolTipLength: null
};
-
+
/**
* Initialize plugin.
*/
@@ -31,7 +31,7 @@
if (options.enableForCells) _grid.onMouseEnter.subscribe(handleMouseEnter);
if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.subscribe(handleHeaderMouseEnter);
}
-
+
/**
* Destroy plugin.
*/
@@ -39,7 +39,7 @@
if (options.enableForCells) _grid.onMouseEnter.unsubscribe(handleMouseEnter);
if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.unsubscribe(handleHeaderMouseEnter);
}
-
+
/**
* Handle mouse entering grid cell to add/remove tooltip.
* @param {jQuery.Event} e - The event
@@ -60,7 +60,7 @@
$node.attr("title", text);
}
}
-
+
/**
* Handle mouse entering header cell to add/remove tooltip.
* @param {jQuery.Event} e - The event
@@ -73,7 +73,7 @@
$node.attr("title", ($node.innerWidth() < $node[0].scrollWidth) ? column.name : "");
}
}
-
+
// Public API
$.extend(this, {
"init": init,
diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js
index c74018de..66c2376c 100644
--- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js
+++ b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js
@@ -46,10 +46,12 @@
if (e.which == 86 && (e.ctrlKey || e.metaKey)) {
if (_copiedRanges) {
e.preventDefault();
- clearCopySelection();
ranges = _grid.getSelectionModel().getSelectedRanges();
_self.onPasteCells.notify({from: _copiedRanges, to: ranges});
- _copiedRanges = null;
+ if (!_grid.getOptions().preserveCopiedSelectionOnPaste) {
+ clearCopySelection();
+ _copiedRanges = null;
+ }
}
}
}
diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js
new file mode 100644
index 00000000..fec7cb2a
--- /dev/null
+++ b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js
@@ -0,0 +1,449 @@
+(function ($) {
+ // register namespace
+ $.extend(true, window, {
+ "Slick": {
+ "CellExternalCopyManager": CellExternalCopyManager
+ }
+ });
+
+
+ function CellExternalCopyManager(options) {
+ /*
+ This manager enables users to copy/paste data from/to an external Spreadsheet application
+ such as MS-Excel® or OpenOffice-Spreadsheet.
+
+ Since it is not possible to access directly the clipboard in javascript, the plugin uses
+ a trick to do it's job. After detecting the keystroke, we dynamically create a textarea
+ where the browser copies/pastes the serialized data.
+
+ options:
+ copiedCellStyle : sets the css className used for copied cells. default : "copied"
+ copiedCellStyleLayerKey : sets the layer key for setting css values of copied cells. default : "copy-manager"
+ dataItemColumnValueExtractor : option to specify a custom column value extractor function
+ dataItemColumnValueSetter : option to specify a custom column value setter function
+ clipboardCommandHandler : option to specify a custom handler for paste actions
+ includeHeaderWhenCopying : set to true and the plugin will take the name property from each column (which is usually what appears in your header) and put that as the first row of the text that's copied to the clipboard
+ bodyElement: option to specify a custom DOM element which to will be added the hidden textbox. It's useful if the grid is inside a modal dialog.
+ onCopyInit: optional handler to run when copy action initializes
+ onCopySuccess: optional handler to run when copy action is complete
+ newRowCreator: function to add rows to table if paste overflows bottom of table
+ readOnlyMode: suppresses paste
+ */
+ var _grid;
+ var _self = this;
+ var _copiedRanges;
+ var _options = options || {};
+ var _copiedCellStyleLayerKey = _options.copiedCellStyleLayerKey || "copy-manager";
+ var _copiedCellStyle = _options.copiedCellStyle || "copied";
+ var _clearCopyTI = 0;
+ var _bodyElement = _options.bodyElement || document.body;
+ var _onCopyInit = _options.onCopyInit || null;
+ var _onCopySuccess = _options.onCopySuccess || null;
+
+ var keyCodes = {
+ 'C': 67,
+ 'V': 86,
+ 'ESC': 27,
+ 'INSERT': 45
+ };
+
+ function init(grid) {
+ _grid = grid;
+ _grid.onKeyDown.subscribe(handleKeyDown);
+
+ // we need a cell selection model
+ var cellSelectionModel = grid.getSelectionModel();
+ if (!cellSelectionModel){
+ throw new Error("Selection model is mandatory for this plugin. Please set a selection model on the grid before adding this plugin: grid.setSelectionModel(new Slick.CellSelectionModel())");
+ }
+ // we give focus on the grid when a selection is done on it.
+ // without this, if the user selects a range of cell without giving focus on a particular cell, the grid doesn't get the focus and key stroke handles (ctrl+c) don't work
+ cellSelectionModel.onSelectedRangesChanged.subscribe(function(e, args){
+ _grid.focus();
+ });
+ }
+
+ function destroy() {
+ _grid.onKeyDown.unsubscribe(handleKeyDown);
+ }
+
+ function getDataItemValueForColumn(item, columnDef) {
+ if (_options.dataItemColumnValueExtractor) {
+ var dataItemColumnValueExtractorValue = _options.dataItemColumnValueExtractor(item, columnDef);
+
+ if (dataItemColumnValueExtractorValue)
+ return dataItemColumnValueExtractorValue;
+ }
+
+ var retVal = '';
+
+ // if a custom getter is not defined, we call serializeValue of the editor to serialize
+ if (columnDef.editor){
+ var editorArgs = {
+ 'container':$("
"), // a dummy container
+ 'column':columnDef,
+ 'position':{'top':0, 'left':0}, // a dummy position required by some editors
+ 'grid':_grid
+ };
+ var editor = new columnDef.editor(editorArgs);
+ editor.loadValue(item);
+ retVal = editor.serializeValue();
+ editor.destroy();
+ }
+ else {
+ retVal = item[columnDef.field];
+ }
+
+ return retVal;
+ }
+
+ function setDataItemValueForColumn(item, columnDef, value) {
+ if (_options.dataItemColumnValueSetter) {
+ return _options.dataItemColumnValueSetter(item, columnDef, value);
+ }
+
+ // if a custom setter is not defined, we call applyValue of the editor to unserialize
+ if (columnDef.editor){
+ var editorArgs = {
+ 'container':$("body"), // a dummy container
+ 'column':columnDef,
+ 'position':{'top':0, 'left':0}, // a dummy position required by some editors
+ 'grid':_grid
+ };
+ var editor = new columnDef.editor(editorArgs);
+ editor.loadValue(item);
+ editor.applyValue(item, value);
+ editor.destroy();
+ }
+ }
+
+
+ function _createTextBox(innerText){
+ var ta = document.createElement('textarea');
+ ta.style.position = 'absolute';
+ ta.style.left = '-1000px';
+ ta.style.top = document.body.scrollTop + 'px';
+ ta.value = innerText;
+ _bodyElement.appendChild(ta);
+ ta.select();
+
+ return ta;
+ }
+
+ function _decodeTabularData(_grid, ta){
+ var columns = _grid.getColumns();
+ var clipText = ta.value;
+ var clipRows = clipText.split(/[\n\f\r]/);
+ // trim trailing CR if present
+ if (clipRows[clipRows.length - 1]=="") { clipRows.pop(); }
+
+ var clippedRange = [];
+ var j = 0;
+
+ _bodyElement.removeChild(ta);
+ for (var i=0; i _grid.getDataLength();
+
+ if (_options.newRowCreator && overflowsBottomOfGrid) {
+
+ var newRowsNeeded = activeRow + destH - _grid.getDataLength();
+
+ _options.newRowCreator(newRowsNeeded);
+
+ }
+
+ var clipCommand = {
+
+ isClipboardCommand: true,
+ clippedRange: clippedRange,
+ oldValues: [],
+ cellExternalCopyManager: _self,
+ _options: _options,
+ setDataItemValueForColumn: setDataItemValueForColumn,
+ markCopySelection: markCopySelection,
+ oneCellToMultiple: oneCellToMultiple,
+ activeRow: activeRow,
+ activeCell: activeCell,
+ destH: destH,
+ destW: destW,
+ maxDestY: _grid.getDataLength(),
+ maxDestX: _grid.getColumns().length,
+ h: 0,
+ w: 0,
+
+ execute: function() {
+ this.h=0;
+ for (var y = 0; y < this.destH; y++){
+ this.oldValues[y] = [];
+ this.w=0;
+ this.h++;
+ for (var x = 0; x < this.destW; x++){
+ this.w++;
+ var desty = activeRow + y;
+ var destx = activeCell + x;
+
+ if (desty < this.maxDestY && destx < this.maxDestX ) {
+ var nd = _grid.getCellNode(desty, destx);
+ var dt = _grid.getDataItem(desty);
+ this.oldValues[y][x] = dt[columns[destx]['field']];
+ if (oneCellToMultiple)
+ this.setDataItemValueForColumn(dt, columns[destx], clippedRange[0][0]);
+ else
+ this.setDataItemValueForColumn(dt, columns[destx], clippedRange[y] ? clippedRange[y][x] : '');
+ _grid.updateCell(desty, destx);
+ _grid.onCellChange.notify({
+ row: desty,
+ cell: destx,
+ item: dt,
+ grid: _grid
+ });
+
+ }
+ }
+ }
+
+ var bRange = {
+ 'fromCell': activeCell,
+ 'fromRow': activeRow,
+ 'toCell': activeCell+this.w-1,
+ 'toRow': activeRow+this.h-1
+ }
+
+ this.markCopySelection([bRange]);
+ _grid.getSelectionModel().setSelectedRanges([bRange]);
+ this.cellExternalCopyManager.onPasteCells.notify({ranges: [bRange]});
+ },
+
+ undo: function() {
+ for (var y = 0; y < this.destH; y++){
+ for (var x = 0; x < this.destW; x++){
+ var desty = activeRow + y;
+ var destx = activeCell + x;
+
+ if (desty < this.maxDestY && destx < this.maxDestX ) {
+ var nd = _grid.getCellNode(desty, destx);
+ var dt = _grid.getDataItem(desty);
+ if (oneCellToMultiple)
+ this.setDataItemValueForColumn(dt, columns[destx], this.oldValues[0][0]);
+ else
+ this.setDataItemValueForColumn(dt, columns[destx], this.oldValues[y][x]);
+ _grid.updateCell(desty, destx);
+ _grid.onCellChange.notify({
+ row: desty,
+ cell: destx,
+ item: dt,
+ grid: _grid
+ });
+ }
+ }
+ }
+
+ var bRange = {
+ 'fromCell': activeCell,
+ 'fromRow': activeRow,
+ 'toCell': activeCell+this.w-1,
+ 'toRow': activeRow+this.h-1
+ }
+
+ this.markCopySelection([bRange]);
+ _grid.getSelectionModel().setSelectedRanges([bRange]);
+ this.cellExternalCopyManager.onPasteCells.notify({ranges: [bRange]});
+
+ if(addRows > 1){
+ var d = _grid.getData();
+ for(; addRows > 1; addRows--)
+ d.splice(d.length - 1, 1);
+ _grid.setData(d);
+ _grid.render();
+ }
+ }
+ };
+
+ if(_options.clipboardCommandHandler) {
+ _options.clipboardCommandHandler(clipCommand);
+ }
+ else {
+ clipCommand.execute();
+ }
+ }
+
+
+ function handleKeyDown(e, args) {
+ var ranges;
+ if (!_grid.getEditorLock().isActive() || _grid.getOptions().autoEdit) {
+ if (e.which == keyCodes.ESC) {
+ if (_copiedRanges) {
+ e.preventDefault();
+ clearCopySelection();
+ _self.onCopyCancelled.notify({ranges: _copiedRanges});
+ _copiedRanges = null;
+ }
+ }
+
+ if ((e.which === keyCodes.C || e.which === keyCodes.INSERT) && (e.ctrlKey || e.metaKey) && !e.shiftKey) { // CTRL+C or CTRL+INS
+ if (_onCopyInit) {
+ _onCopyInit.call();
+ }
+ ranges = _grid.getSelectionModel().getSelectedRanges();
+ if (ranges.length != 0) {
+ _copiedRanges = ranges;
+ markCopySelection(ranges);
+ _self.onCopyCells.notify({ranges: ranges});
+
+ var columns = _grid.getColumns();
+ var clipText = "";
+
+ for (var rg = 0; rg < ranges.length; rg++){
+ var range = ranges[rg];
+ var clipTextRows = [];
+ for (var i=range.fromRow; i< range.toRow+1 ; i++){
+ var clipTextCells = [];
+ var dt = _grid.getDataItem(i);
+
+ if (clipTextRows == "" && _options.includeHeaderWhenCopying) {
+ var clipTextHeaders = [];
+ for (var j = range.fromCell; j < range.toCell + 1 ; j++) {
+ if (columns[j].name.length > 0)
+ clipTextHeaders.push(columns[j].name);
+ }
+ clipTextRows.push(clipTextHeaders.join("\t"));
+ }
+
+ for (var j=range.fromCell; j< range.toCell+1 ; j++){
+ clipTextCells.push(getDataItemValueForColumn(dt, columns[j]));
+ }
+ clipTextRows.push(clipTextCells.join("\t"));
+ }
+ clipText += clipTextRows.join("\r\n") + "\r\n";
+ }
+
+ if(window.clipboardData) {
+ window.clipboardData.setData("Text", clipText);
+ return true;
+ }
+ else {
+ var focusEl = document.activeElement;
+
+ var ta = _createTextBox(clipText);
+
+ ta.focus();
+
+ setTimeout(function(){
+ _bodyElement.removeChild(ta);
+ // restore focus
+ if (focusEl)
+ focusEl.focus();
+ else
+ console.log("Not element to restore focus to after copy?");
+
+ }, 100);
+
+ if (_onCopySuccess) {
+ var rowCount = 0;
+ // If it's cell selection, use the toRow/fromRow fields
+ if (ranges.length === 1) {
+ rowCount = (ranges[0].toRow + 1) - ranges[0].fromRow;
+ }
+ else {
+ rowCount = ranges.length;
+ }
+ _onCopySuccess.call(this, rowCount);
+ }
+
+ return false;
+ }
+ }
+ }
+
+ if (!_options.readOnlyMode && (
+ (e.which === keyCodes.V && (e.ctrlKey || e.metaKey) && !e.shiftKey)
+ || (e.which === keyCodes.INSERT && e.shiftKey && !e.ctrlKey)
+ )) { // CTRL+V or Shift+INS
+ var ta = _createTextBox('');
+
+ setTimeout(function(){
+ _decodeTabularData(_grid, ta);
+ }, 100);
+
+ return false;
+ }
+ }
+ }
+
+ function markCopySelection(ranges) {
+ clearCopySelection();
+
+ var columns = _grid.getColumns();
+ var hash = {};
+ for (var i = 0; i < ranges.length; i++) {
+ for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) {
+ hash[j] = {};
+ for (var k = ranges[i].fromCell; k <= ranges[i].toCell && k= 0 && active < _grid.getDataLength()) {
_grid.scrollRowIntoView(active);
- _ranges = rowsToRanges(getRowsRange(top, bottom));
- setSelectedRanges(_ranges);
+ var tempRanges = rowsToRanges(getRowsRange(top, bottom));
+ setSelectedRanges(tempRanges);
}
e.preventDefault();
@@ -166,8 +166,8 @@
_grid.setActiveCell(cell.row, cell.cell);
}
- _ranges = rowsToRanges(selection);
- setSelectedRanges(_ranges);
+ var tempRanges = rowsToRanges(selection);
+ setSelectedRanges(tempRanges);
e.stopImmediatePropagation();
return true;
diff --git a/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css b/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css
index 2338d6e7..efc74154 100644
--- a/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css
+++ b/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css
@@ -29,23 +29,23 @@ classes should alter those!
height: 100%;
}
-.sr.ui-state-active {
+.slick-row.ui-state-active {
background: #F5F7D7;
}
-.sr {
+.slick-row {
position: absolute;
background: white;
border: 0px;
line-height: 20px;
}
-.sr.selected {
+.slick-row.selected {
z-index: 10;
background: #DFE8F6;
}
-.sc {
+.slick-cell {
padding-left: 4px;
padding-right: 4px;
}
@@ -73,11 +73,11 @@ classes should alter those!
background: white;
}
-.sc.selected {
+.slick-cell.selected {
background-color: beige;
}
-.sc.active {
+.slick-cell.active {
border-color: gray;
border-style: solid;
}
@@ -86,25 +86,25 @@ classes should alter those!
background: silver !important;
}
-.sr.odd {
+.slick-row.odd {
background: #fafafa;
}
-.sr.ui-state-active {
+.slick-row.ui-state-active {
background: #F5F7D7;
}
-.sr.loading {
+.slick-row.loading {
opacity: 0.5;
filter: alpha(opacity = 50);
}
-.sc.invalid {
+.slick-cell.invalid {
border-color: red;
-moz-animation-duration: 0.2s;
-webkit-animation-duration: 0.2s;
-moz-animation-name: slickgrid-invalid-hilite;
- -webkit-animation-name: slickgrid-invalid-hilite;
+ -webkit-animation-name: slickgrid-invalid-hilite;
}
@-moz-keyframes slickgrid-invalid-hilite {
diff --git a/web/pgadmin/static/vendor/slickgrid/slick.core.js b/web/pgadmin/static/vendor/slickgrid/slick.core.js
index c4f04ec4..1846a50a 100644
--- a/web/pgadmin/static/vendor/slickgrid/slick.core.js
+++ b/web/pgadmin/static/vendor/slickgrid/slick.core.js
@@ -40,7 +40,8 @@
RIGHT: 39,
TAB: 9,
UP: 38
- }
+ },
+ "preClickClassName" : "slick-edit-preclick"
}
});
@@ -423,7 +424,7 @@
/***
* Sets the specified edit controller as the active edit controller (acquire edit lock).
- * If another edit controller is already active, and exception will be thrown.
+ * If another edit controller is already active, and exception will be throw new Error(.
* @method activate
* @param editController {EditController} edit controller acquiring the lock
*/
@@ -432,26 +433,26 @@
return;
}
if (activeEditController !== null) {
- throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController";
+ throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController");
}
if (!editController.commitCurrentEdit) {
- throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()";
+ throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()");
}
if (!editController.cancelCurrentEdit) {
- throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()";
+ throw new Error("SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()");
}
activeEditController = editController;
};
/***
* Unsets the specified edit controller as the active edit controller (release edit lock).
- * If the specified edit controller is not the active one, an exception will be thrown.
+ * If the specified edit controller is not the active one, an exception will be throw new Error(.
* @method deactivate
* @param editController {EditController} edit controller releasing the lock
*/
this.deactivate = function (editController) {
if (activeEditController !== editController) {
- throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one";
+ throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one");
}
activeEditController = null;
};
diff --git a/web/pgadmin/static/vendor/slickgrid/slick.dataview.js b/web/pgadmin/static/vendor/slickgrid/slick.dataview.js
index f62df669..b004b800 100644
--- a/web/pgadmin/static/vendor/slickgrid/slick.dataview.js
+++ b/web/pgadmin/static/vendor/slickgrid/slick.dataview.js
@@ -107,7 +107,7 @@
for (var i = startingIndex, l = items.length; i < l; i++) {
id = items[i][idProperty];
if (id === undefined) {
- throw "Each data element must implement a unique 'id' property";
+ throw new Error("Each data element must implement a unique 'id' property");
}
idxById[id] = i;
}
@@ -118,7 +118,7 @@
for (var i = 0, l = items.length; i < l; i++) {
id = items[i][idProperty];
if (id === undefined || idxById[id] !== i) {
- throw "Each data element must implement a unique 'id' property";
+ throw new Error("Each data element must implement a unique 'id' property");
}
}
}
@@ -210,6 +210,15 @@
}
}
+ function getFilteredItems(){
+ return filteredItems;
+ }
+
+
+ function getFilter(){
+ return filter;
+ }
+
function setFilter(filterFn) {
filter = filterFn;
if (options.inlineFilters) {
@@ -330,7 +339,7 @@
function updateItem(id, item) {
if (idxById[id] === undefined || id !== item[idProperty]) {
- throw "Invalid or non-matching id";
+ throw new Error("Invalid or non-matching id");
}
items[idxById[id]] = item;
if (!updated) {
@@ -355,7 +364,7 @@
function deleteItem(id) {
var idx = idxById[id];
if (idx === undefined) {
- throw "Invalid id";
+ throw new Error("Invalid id");
}
delete idxById[id];
items.splice(idx, 1);
@@ -516,7 +525,7 @@
group = groups[i];
group.groups = extractGroups(group.rows, group);
}
- }
+ }
groups.sort(groupingInfos[level].comparer);
@@ -566,7 +575,7 @@
level = level || 0;
var gi = groupingInfos[level];
var groupCollapsed = gi.collapsed;
- var toggledGroups = toggledGroupsByLevel[level];
+ var toggledGroups = toggledGroupsByLevel[level];
var idx = groups.length, g;
while (idx--) {
g = groups[idx];
@@ -588,7 +597,7 @@
g.collapsed = groupCollapsed ^ toggledGroups[g.groupingKey];
g.title = gi.formatter ? gi.formatter(g) : g.value;
}
- }
+ }
function flattenGroupedRows(groups, level) {
level = level || 0;
@@ -762,14 +771,17 @@
// get the current page
var paged;
if (pagesize) {
- if (filteredItems.length < pagenum * pagesize) {
- pagenum = Math.floor(filteredItems.length / pagesize);
+ if (filteredItems.length <= pagenum * pagesize) {
+ if (filteredItems.length === 0) {
+ pagenum = 0;
+ } else {
+ pagenum = Math.floor((filteredItems.length - 1) / pagesize);
+ }
}
paged = filteredItems.slice(pagesize * pagenum, pagesize * pagenum + pagesize);
} else {
paged = filteredItems;
}
-
return {totalRows: filteredItems.length, rows: paged};
}
@@ -916,7 +928,7 @@
inHandler = true;
var selectedRows = self.mapIdsToRows(selectedRowIds);
if (!preserveHidden) {
- setSelectedRowIds(self.mapRowsToIds(selectedRows));
+ setSelectedRowIds(self.mapRowsToIds(selectedRows));
}
grid.setSelectedRows(selectedRows);
inHandler = false;
@@ -980,6 +992,10 @@
if (key != args.key) { return; }
if (args.hash) {
storeCellCssStyles(args.hash);
+ } else {
+ grid.onCellCssStylesChanged.unsubscribe(styleChanged);
+ self.onRowsChanged.unsubscribe(update);
+ self.onRowCountChanged.unsubscribe(update);
}
});
@@ -997,6 +1013,8 @@
"getItems": getItems,
"setItems": setItems,
"setFilter": setFilter,
+ "getFilter": getFilter,
+ "getFilteredItems": getFilteredItems,
"sort": sort,
"fastSort": fastSort,
"reSort": reSort,
diff --git a/web/pgadmin/static/vendor/slickgrid/slick.editors.js b/web/pgadmin/static/vendor/slickgrid/slick.editors.js
index e852592c..33b4e266 100644
--- a/web/pgadmin/static/vendor/slickgrid/slick.editors.js
+++ b/web/pgadmin/static/vendor/slickgrid/slick.editors.js
@@ -11,7 +11,7 @@
"Editors": {
"Text": TextEditor,
"Integer": IntegerEditor,
- "Float": FloatEditor,
+ "Float": FloatEditor,
"Date": DateEditor,
"YesNoSelect": YesNoSelectEditor,
"Checkbox": CheckboxEditor,
@@ -29,7 +29,7 @@
this.init = function () {
$input = $("")
.appendTo(args.container)
- .bind("keydown.nav", function (e) {
+ .on("keydown.nav", function (e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
@@ -98,7 +98,7 @@
this.init = function () {
$input = $("");
- $input.bind("keydown.nav", function (e) {
+ $input.on("keydown.nav", function (e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
@@ -167,7 +167,7 @@
this.init = function () {
$input = $("");
- $input.bind("keydown.nav", function (e) {
+ $input.on("keydown.nav", function (e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
e.stopImmediatePropagation();
}
@@ -185,24 +185,24 @@
$input.focus();
};
- function getDecimalPlaces() {
- // returns the number of fixed decimal places or null
- var rtn = args.column.editorFixedDecimalPlaces;
- if (typeof rtn == 'undefined') {
- rtn = FloatEditor.DefaultDecimalPlaces;
- }
- return (!rtn && rtn!==0 ? null : rtn);
- }
+ function getDecimalPlaces() {
+ // returns the number of fixed decimal places or null
+ var rtn = args.column.editorFixedDecimalPlaces;
+ if (typeof rtn == 'undefined') {
+ rtn = FloatEditor.DefaultDecimalPlaces;
+ }
+ return (!rtn && rtn!==0 ? null : rtn);
+ }
this.loadValue = function (item) {
defaultValue = item[args.column.field];
- var decPlaces = getDecimalPlaces();
- if (decPlaces !== null
- && (defaultValue || defaultValue===0)
- && defaultValue.toFixed) {
- defaultValue = defaultValue.toFixed(decPlaces);
- }
+ var decPlaces = getDecimalPlaces();
+ if (decPlaces !== null
+ && (defaultValue || defaultValue===0)
+ && defaultValue.toFixed) {
+ defaultValue = defaultValue.toFixed(decPlaces);
+ }
$input.val(defaultValue);
$input[0].defaultValue = defaultValue;
@@ -210,14 +210,14 @@
};
this.serializeValue = function () {
- var rtn = parseFloat($input.val()) || 0;
+ var rtn = parseFloat($input.val()) || 0;
- var decPlaces = getDecimalPlaces();
- if (decPlaces !== null
- && (rtn || rtn===0)
- && rtn.toFixed) {
- rtn = parseFloat(rtn.toFixed(decPlaces));
- }
+ var decPlaces = getDecimalPlaces();
+ if (decPlaces !== null
+ && (rtn || rtn===0)
+ && rtn.toFixed) {
+ rtn = parseFloat(rtn.toFixed(decPlaces));
+ }
return rtn;
};
@@ -269,8 +269,7 @@
$input.datepicker({
showOn: "button",
buttonImageOnly: true,
- buttonImage: "../images/calendar.gif",
- beforeShow: function () {
+ beforeShow: function () {
calendarOpen = true
},
onClose: function () {
@@ -422,6 +421,10 @@
}
};
+ this.preClick = function () {
+ $select.prop('checked', !$select.prop('checked'));
+ };
+
this.serializeValue = function () {
return $select.prop('checked');
};
@@ -470,7 +473,7 @@
}
});
- $picker.find(".editor-percentcomplete-buttons button").bind("click", function (e) {
+ $picker.find(".editor-percentcomplete-buttons button").on("click", function (e) {
$input.val($(this).attr("val"));
$picker.find(".editor-percentcomplete-slider").slider("value", $(this).attr("val"));
})
@@ -535,15 +538,15 @@
$wrapper = $("")
.appendTo($container);
- $input = $("