diff --git a/libraries.txt b/libraries.txt index 7e0bd5b7..32effda4 100644 --- a/libraries.txt +++ b/libraries.txt @@ -1,36 +1,36 @@ This is a list of the third party libraries/code used in the application, not including Python modules installed via Pip which are listed in requirements.txt. -Library Version Licence URL -======= ======= ======= === -QT 4.6.2+ LGPL v2.1/3 http://www.qt.io/ -Bootstrap 3.3.4 MIT http://getbootstrap.com/ -jQuery 1.11.1 MIT http://jquery.com/ -Modernizr 2.6.2 MIT/BSD http://modernizr.com/ -AlertifyJS 1.7.1 MIT http://alertifyjs.com/ *** Do not update - changed to GPL3 in 1.8.0 *** -CodeMirror 5.14.2 MIT http://codemirror.net/ -aciTree 4.5.0-rc.7 MIT/GPL http://acoderinsights.ro/en/aciTree-tree-view-with-jQuery -contextMenu 2.1.0 MIT https://github.com/swisnl/jQuery-contextMenu -wcDocker 0f5690318c MIT/GPL https://github.com/WebCabin/wcDocker -Require.js 2.1.18 BSD/MIT http://requirejs.org/ -Underscore.js 1.8.3 MIT http://underscorejs.org/ -Underscore.string 387ab72d49 MIT http://epeli.github.io/underscore.string/ -Backform.js 5859b4f9db MIT https://github.com/AmiliaApp/backform -Backbone 1.1.2 MIT http://backbonejs.org -font-Awesome 4.5 SIL OFL http://fortawesome.github.io/Font-Awesome/ -font-mfizz 2.3 MIT http://fizzed.com/oss/font-mfizz -backgrid.js 0.3.5 MIT http://backgridjs.com/ -backbone.undo 0.2 MIT http://backbone.undojs.com/ -bootstrap-switch 3.3.2 MIT http://www.bootstrap-switch.org/ -select2 4.0.1 MIT https://select2.github.io/ -backgrid-filter 01b2b21 MIT https://github.com/wyuenho/backgrid-filter -backbone.paginator 2.0.3 MIT http://github.com/backbone-paginator/backbone.paginator -backgrid-paginator 03632df MIT https://github.com/wyuenho/backgrid-paginator -backgrid-select-all 1a00053 MIT https://github.com/wyuenho/backgrid-select-all -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 -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 +Library Version Licence URL +======= ======= ======= === +QT 4.6.2+ LGPL v2.1/3 http://www.qt.io/ +Bootstrap 3.3.4 MIT http://getbootstrap.com/ +jQuery 1.11.1 MIT http://jquery.com/ +Modernizr 2.6.2 MIT/BSD http://modernizr.com/ +AlertifyJS 1.7.1 MIT http://alertifyjs.com/ *** Do not update - changed to GPL3 in 1.8.0 *** +CodeMirror 5.14.2 MIT http://codemirror.net/ +aciTree 4.5.0-rc.7 MIT/GPL http://acoderinsights.ro/en/aciTree-tree-view-with-jQuery +contextMenu 2.1.0 MIT https://github.com/swisnl/jQuery-contextMenu +wcDocker 0f5690318c MIT/GPL https://github.com/WebCabin/wcDocker +Require.js 2.1.18 BSD/MIT http://requirejs.org/ +Underscore.js 1.8.3 MIT http://underscorejs.org/ +Underscore.string 387ab72d49 MIT http://epeli.github.io/underscore.string/ +Backform.js 5859b4f9db MIT https://github.com/AmiliaApp/backform +Backbone 1.1.2 MIT http://backbonejs.org +font-Awesome 4.5 SIL OFL http://fortawesome.github.io/Font-Awesome/ +font-mfizz 2.3 MIT http://fizzed.com/oss/font-mfizz +backgrid.js 0.3.5 MIT http://backgridjs.com/ +backbone.undo 0.2 MIT http://backbone.undojs.com/ +bootstrap-switch 3.3.2 MIT http://www.bootstrap-switch.org/ +select2 4.0.1 MIT https://select2.github.io/ +backgrid-filter 01b2b21 MIT https://github.com/wyuenho/backgrid-filter +backbone.paginator 2.0.3 MIT http://github.com/backbone-paginator/backbone.paginator +backgrid-paginator 03632df MIT https://github.com/wyuenho/backgrid-paginator +backgrid-select-all 1a00053 MIT https://github.com/wyuenho/backgrid-select-all +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.3.7-8ff6814 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/karma.conf.js b/web/karma.conf.js index 713b9f05..39697ca7 100644 --- a/web/karma.conf.js +++ b/web/karma.conf.js @@ -17,6 +17,7 @@ module.exports = function (config) { {pattern: 'pgadmin/browser/static/js/**/*.js', included: false}, 'regression/javascript/**/*.jsx', 'regression/javascript/**/*.js', + 'pgadmin/static/bundle/slickgrid.js', ], // list of files to exclude @@ -30,6 +31,7 @@ module.exports = function (config) { preprocessors: { 'regression/javascript/**/*.js': ['webpack'], 'regression/javascript/**/*.jsx': ['webpack'], + 'pgadmin/static/bundle/slickgrid.js': ['webpack'], }, webpack: webpackConfig, diff --git a/web/package.json b/web/package.json index b58af2e9..8df8097f 100644 --- a/web/package.json +++ b/web/package.json @@ -4,6 +4,7 @@ "babel-loader": "~6.4.1", "babel-preset-es2015": "~6.24.0", "babel-preset-react": "~6.23.0", + "css-loader": "^0.28.4", "enzyme": "~2.8.2", "enzyme-matchers": "^3.1.0", "eslint": "^3.19.0", @@ -19,7 +20,9 @@ "karma-requirejs": "~1.1.0", "karma-sourcemap-loader": "~0.3.7", "karma-webpack": "~2.0.3", + "raw-loader": "^0.5.1", "react-addons-test-utils": "~15.4.2", + "style-loader": "^0.18.2", "webpack": "~2.3.1" }, "dependencies": { @@ -36,12 +39,13 @@ "react": "file:../web/pgadmin/static/vendor/react", "react-dom": "file:../web/pgadmin/static/vendor/react-dom", "requirejs": "~2.3.3", + "slickgrid": "git+https://github.com/6pac/SlickGrid.git#2.3.7", "underscore": "~1.8.3", "watchify": "~3.9.0" }, "scripts": { "linter": "yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js", - "webpacker": "yarn run webpack -- --optimize-minimize --config webpack.config.js", + "webpacker": "yarn run webpack -- --config webpack.config.js", "webpacker:dev": "yarn run webpack -- --config webpack.config.js", "bundle": "yarn run linter && yarn run webpacker", "bundle:dev": "yarn run linter && yarn run webpacker:dev", diff --git a/web/pgadmin/static/jsx/components.jsx b/web/pgadmin/static/bundle/components.js similarity index 64% rename from web/pgadmin/static/jsx/components.jsx rename to web/pgadmin/static/bundle/components.js index 6ff34e4c..221beff1 100644 --- a/web/pgadmin/static/jsx/components.jsx +++ b/web/pgadmin/static/bundle/components.js @@ -1,7 +1,6 @@ - import React from 'react'; import {render} from 'react-dom'; -import QueryHistory from './history/query_history'; +import QueryHistory from '../jsx/history/query_history'; export { render, diff --git a/web/pgadmin/static/bundle/slickgrid.js b/web/pgadmin/static/bundle/slickgrid.js new file mode 100644 index 00000000..0d82a6bd --- /dev/null +++ b/web/pgadmin/static/bundle/slickgrid.js @@ -0,0 +1,13 @@ +import 'slickgrid/slick.grid.css'; +import 'slickgrid/slick-default-theme.css'; +import 'slickgrid/css/smoothness/jquery-ui-1.11.3.custom.css'; +import 'slickgrid/slick.core'; +import 'slickgrid/slick.grid'; +import 'slickgrid/slick.editors'; +import 'slickgrid/slick.formatters'; +import 'slickgrid/plugins/slick.autotooltips'; +import 'slickgrid/plugins/slick.cellrangedecorator'; +import 'slickgrid/plugins/slick.cellrangeselector'; +import 'slickgrid/lib/jquery.event.drag-2.3.0'; + +export default window.Slick; \ No newline at end of file diff --git a/web/pgadmin/static/js/selection/xcell_selection_model.js b/web/pgadmin/static/js/selection/xcell_selection_model.js index 974b7479..8a128c43 100644 --- a/web/pgadmin/static/js/selection/xcell_selection_model.js +++ b/web/pgadmin/static/js/selection/xcell_selection_model.js @@ -2,10 +2,9 @@ define([ 'jquery', 'underscore', 'sources/selection/range_selection_helper', - 'sources/slickgrid/pgslick.cellrangeselector', 'slickgrid', -], function ($, _, RangeSelectionHelper, PGCellRangeSelector) { +], function ($, _, RangeSelectionHelper) { var XCellSelectionModel = function (options) { var KEY_ARROW_RIGHT = 39; @@ -17,7 +16,7 @@ define([ var _grid; var _ranges = []; var _self = this; - var _selector = new PGCellRangeSelector({ + var _selector = new Slick.CellRangeSelector({ 'selectionCss': { 'border': '2px solid black', }, diff --git a/web/pgadmin/static/js/slickgrid/pgslick.cellrangedecorator.js b/web/pgadmin/static/js/slickgrid/pgslick.cellrangedecorator.js deleted file mode 100644 index 8b0e340f..00000000 --- a/web/pgadmin/static/js/slickgrid/pgslick.cellrangedecorator.js +++ /dev/null @@ -1,73 +0,0 @@ -define([ - 'jquery', - - 'slickgrid', -], function ($) { - /*** - * Displays an overlay on top of a given cell range. - * - * TODO: - * Currently, it blocks mouse events to DOM nodes behind it. - * Use FF and WebKit-specific "pointer-events" CSS style, or some kind of event forwarding. - * Could also construct the borders separately using 4 individual DIVs. - * - * @param {Grid} grid - * @param {Object} options - */ - var PGCellRangeDecorator = function (grid, options) { - var _elem; - var _defaults = { - selectionCssClass: 'slick-range-decorator', - selectionCss: { - "zIndex": "9999", - "border": "2px dashed red" - } - }; - - options = $.extend(true, {}, _defaults, options); - - - function show(range) { - if (!_elem) { - _elem = $("
", {css: options.selectionCss}) - .addClass(options.selectionCssClass) - .css("position", "absolute") - .appendTo(grid.getCanvasNode()); - } - - var from = grid.getCellNodeBox(range.fromRow, range.fromCell); - var to = grid.getCellNodeBox(range.toRow, range.toCell); - - // TODO: This is the original Slickgrid code temporary fix to solve - // pgAdmin alignment of the selection box on the bottom right corner - // _elem.css({ - // top: from.top - 1, - // left: from.left - 1, - // height: to.bottom - from.top - 2, - // width: to.right - from.left - 2 - // }); - - _elem.css({ - top: from.top - 1, - left: from.left - 1, - height: to.bottom - from.top + 2, - width: to.right - from.left + 1 - }); - - return _elem; - } - - function hide() { - if (_elem) { - _elem.remove(); - _elem = null; - } - } - - $.extend(this, { - "show": show, - "hide": hide - }); - }; - return PGCellRangeDecorator; -}); diff --git a/web/pgadmin/static/js/slickgrid/pgslick.cellrangeselector.js b/web/pgadmin/static/js/slickgrid/pgslick.cellrangeselector.js deleted file mode 100644 index 6a8649bc..00000000 --- a/web/pgadmin/static/js/slickgrid/pgslick.cellrangeselector.js +++ /dev/null @@ -1,119 +0,0 @@ -define([ - 'jquery', - 'sources/slickgrid/pgslick.cellrangedecorator', - - 'slickgrid', -], function ($, PGCellRangeDecorator) { - - var PGCellRangeSelector = function (options) { - var _grid; - var _canvas; - var _currentlySelectedRange; - var _dragging; - var _decorator; - var _self = this; - var _handler = new Slick.EventHandler(); - var _defaults = { - selectionCss: { - "border": "2px dashed blue" - } - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _decorator = new PGCellRangeDecorator(grid, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _handler - .subscribe(_grid.onDragInit, handleDragInit) - .subscribe(_grid.onDragStart, handleDragStart) - .subscribe(_grid.onDrag, handleDrag) - .subscribe(_grid.onDragEnd, handleDragEnd); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { - if (_grid.canCellBeSelected(cell.row, cell.cell)) { - _dragging = true; - e.stopImmediatePropagation(); - } - } - if (!_dragging) { - return; - } - - _grid.focus(); - - var start = _grid.getCellFromPoint( - dd.startX - $(_canvas).offset().left, - dd.startY - $(_canvas).offset().top); - - dd.range = {start: start, end: {}}; - _currentlySelectedRange = dd.range; - return _decorator.show(new Slick.Range(start.row, start.cell)); - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - e.stopImmediatePropagation(); - - var end = _grid.getCellFromPoint( - e.pageX - $(_canvas).offset().left, - e.pageY - $(_canvas).offset().top); - - if (!_grid.canCellBeSelected(end.row, end.cell)) { - return; - } - - dd.range.end = end; - _currentlySelectedRange = dd.range; - _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - - _dragging = false; - e.stopImmediatePropagation(); - - _decorator.hide(); - _self.onCellRangeSelected.notify({ - range: new Slick.Range( - dd.range.start.row, - dd.range.start.cell, - dd.range.end.row, - dd.range.end.cell - ) - }); - } - - function getCurrentRange() { - return _currentlySelectedRange; - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "getCurrentRange": getCurrentRange, - - "onBeforeCellRangeSelected": new Slick.Event(), - "onCellRangeSelected": new Slick.Event() - }); - }; - return PGCellRangeSelector; -}); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/README.md b/web/pgadmin/static/vendor/slickgrid/README.md deleted file mode 100644 index e8a1ad7a..00000000 --- a/web/pgadmin/static/vendor/slickgrid/README.md +++ /dev/null @@ -1,9 +0,0 @@ -## 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.css b/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.css deleted file mode 100644 index bcbb3758..00000000 --- a/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.css +++ /dev/null @@ -1,31 +0,0 @@ -.slick-columnpicker { - border: 1px solid #718BB7; - background: #f0f0f0; - padding: 6px; - -moz-box-shadow: 2px 2px 2px silver; - -webkit-box-shadow: 2px 2px 2px silver; - box-shadow: 2px 2px 2px silver; - min-width: 100px; - cursor: default; -} - -.slick-columnpicker li { - list-style: none; - margin: 0; - padding: 0; - background: none; -} - -.slick-columnpicker input { - margin: 4px; -} - -.slick-columnpicker li a { - display: block; - padding: 4px; - font-weight: bold; -} - -.slick-columnpicker li a:hover { - background: white; -} diff --git a/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js b/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js deleted file mode 100644 index 93a6be5b..00000000 --- a/web/pgadmin/static/vendor/slickgrid/controls/slick.columnpicker.js +++ /dev/null @@ -1,153 +0,0 @@ -(function ($) { - function SlickColumnPicker(columns, grid, options) { - var $menu; - var columnCheckboxes; - - var defaults = { - fadeSpeed:250 - }; - - function init() { - grid.onHeaderContextMenu.subscribe(handleHeaderContextMenu); - grid.onColumnsReordered.subscribe(updateColumnOrder); - options = $.extend({}, defaults, options); - - $menu = $("").appendTo(document.body); - - $menu.on("mouseleave", function (e) { - $(this).fadeOut(options.fadeSpeed) - }); - $menu.on("click", updateColumn); - - } - - function destroy() { - grid.onHeaderContextMenu.unsubscribe(handleHeaderContextMenu); - grid.onColumnsReordered.unsubscribe(updateColumnOrder); - $menu.remove(); - } - - function handleHeaderContextMenu(e, args) { - e.preventDefault(); - $menu.empty(); - updateColumnOrder(); - columnCheckboxes = []; - - var $li, $input; - for (var i = 0; i < columns.length; i++) { - $li = $("").appendTo($menu); - $input = $("").data("column-id", columns[i].id); - columnCheckboxes.push($input); - - if (grid.getColumnIndex(columns[i].id) != null) { - $input.attr("checked", "checked"); - } - - $("") - .html(columns[i].name) - .prepend($input) - .appendTo($li); - } - - $("S*iEN$I#V?9xjA@}>Xoga7rz|MtxP@t*(f zd;jyT|Ma^5_}BT?cIUw`|L>9O(^dcLa{u(R|L~Uo`Rwb_Gym_4@6JNjmm=$!66@0} z+@UAy$58+O|NsC0A^8LW0018VEC2ui01yBW000Gk;3tk`NqT6imL3tk1c6!B=8c}C zdO&j^2-_#;K`Hn@mvv4FO#mmc9hm?C diff --git a/web/pgadmin/static/vendor/slickgrid/images/editor-helper-bg.gif b/web/pgadmin/static/vendor/slickgrid/images/editor-helper-bg.gif deleted file mode 100644 index 2daa973bc525c83872e4a0357b756727ca7eaa49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1164 zcmZ?wbhEHb YF9fS*UcPPtW$y zAC1e8&dfF|PCBwPc)8m=``RLrQxnq8EOwjBBztRfX25cv`Ch$VTVDjNcFA@+x-0Z` z$h!EwVWQk+I+s?bT%LD!*S7528}iR;rCMLljonfHbWv~gw)MC6)cyQ-m%G9s_D~1E z_O{tGJ|^wyRkXimZCQ|baE5+%pU=&W=_lt~H_Pen+LC&1xwbUl+*x0 Syf|Ke-=FW_A3xmP?_a;~@8`E4XYbdGudo02^{2Q(!*@ZAgvM7- z(;qZ(zPtXQo}W)bvFVLvgkp=h*9^s0F29Ng?L2uLi`o^-G?F^SX01r-(n;F!s9yG{ Q#^WB7YZ;4s85tR@0d|1E6951J diff --git a/web/pgadmin/static/vendor/slickgrid/images/expand.gif b/web/pgadmin/static/vendor/slickgrid/images/expand.gif deleted file mode 100644 index 1b24ef1248de55c6140895f6760758a1579f14cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 851 zcmZ?wbhEHb $FyaIl$)g-gPK!J(0fMMMlpH!w1DF=kxpFl=aGX3~-h X>0od?I!Q%XL14k81*aJp85yhr3QsCm diff --git a/web/pgadmin/static/vendor/slickgrid/images/header-bg.gif b/web/pgadmin/static/vendor/slickgrid/images/header-bg.gif deleted file mode 100644 index fe7dd1c1ebedc02d4e1aabf91fe43e1bcae824e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 872 zcmZ?wbhEHbWMt4`Y-eC-S#V_a@i#lpzuR@;-JVPD_g;R#|H_AhS3exO_Tk8lkH>C) zJaOyO$=jb!-~D{{-ski8KVNw8< p u#Ky(P`xTtKWIQ)5IXPLwHYwudrlqH+8zi5a #gWNI1yM!7mYUVnf4WCKe8!85Rx=4Ga>@3=9GS G4Auam1ttan diff --git a/web/pgadmin/static/vendor/slickgrid/images/header-columns-over-bg.gif b/web/pgadmin/static/vendor/slickgrid/images/header-columns-over-bg.gif deleted file mode 100644 index f9c07af1347fc44dcabb1a9d22458deb195fd92b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 823 zcmZ?wbhEHbWMU9wXlGzpb>`d67r$SB{>v~5Mnhoag@EEu7NDp9Gw6W44$2b@93l*? Z95Nmo7Bnz$2y4ZhC{SczU}R*l1^^j55kLR{ diff --git a/web/pgadmin/static/vendor/slickgrid/images/help.png b/web/pgadmin/static/vendor/slickgrid/images/help.png deleted file mode 100644 index 85eca0950fbe19e870f7701b0bfac6b9a96b317b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmV-f0jB >q#r{5kRU>(_?Ij~}ZrFfcGd)iA&mE_?s&(f^0 @ zatoLS@jrk5y!OzcLs~!$%wWYJ6G0N!UT*&1F{$)_aaGFy+O}LUA0+ C;Z2Vs4NP z3?QpPCS858@&D4zJzzRBKNd`b#J_y`avrEq42W4l&iDbc8YBtAArZd+XDw?6vq9oO z!+ru4$^kJa1IRNllR ;ANF3 7lNssco}rj5ThWQEM{YY!5{Q>SQ|VnAEyyN39y;q#3m) z+qF5=D56QMST%|#2nZ+&h! =Fk=Dh+6hOiQYPg;Ed3mv|v$zM)-Zb(Gu~48X8JAIPvHsN_WdkL`{NYU<;}L?q zs $0sXqq^oP|8=JDN z?Va7d{jHC{N|jo3sMYBWMw8iMwb>ocqvI17=(NW<2n93o#Qp8C+gwW9RJqSb&}K+q z`%IPpCpl}}z79@J&=-~G68bxNFE04FaJPB=T>^CE_x$DrYPYZ{<|pMEkBSwy-gx5i z9&`XV*8zDI_AP&)X91hk0euY}#4iz2sX6QXL4t&wF;)3qB8~W_&n*=9t$^0MN-x;q zzfPo+)`yFY%5?#qyg6Qa`s{fagR(VM@%E*3fYG bCusO2cLNxr%Eg#3 zs?Nii0|)bGZxYgl%t4ie^1Yx1K1|cBGJaBR2#4v~P1cjM?;}PS`W^18OW%n`hK%yr zj>J~PDATN3q2_LiMu)9h*;Lj0Uyoh4yDJt5--*XYomSnBp!MtVv16yrsM-{dkN?q! zTd1t`jBmE=SNC9?%=OqaN+EmV6BoMm^qu7Ft!Mt3xUI5tg^I26pt8{IiVG uk{!B(yt {nGcx-4~GHp52$QsDs^CNpTnV z>b^<-aqqX(%$~ja+l2>v=!~+9`we%3GxmSa?(W%d%%dIbHx;li%9|f7|0sW5yx${l zd1N_|x0bqvDKJlca};eA!FWYGGD@lFsErFd=&Vc5Ip}K0#2<7w7b*|1n6j`OoM&B* zvIp0VSK^5@rIJ8lhpC7I%Q>oE#y(y}8nGx 5L&`;vCVw4AFQwe1tMV@DR1 zb{qr_*Rjs{<>@BeLx{Rb&uF!7$|pWtKmATho_@wZi>POxD^lw@LH`Y(;9fxI8F-;s zqJbYyR~rP8oNyy>Rgz~E#>k0A(RHiZD82#y*fjg4-(AxjB&63g4~y2A7LwvWHZOjY za@V|+n$>GwzFnj-OVa-tWLfzEeb@3P8{2D<=Fv5l)dJ4P*0l$cyVmt$d9QWjkyT^e zECol{WKaF_ZCe!~B-=JJ`p~vh8y{ictxL(b?=@tR?EB3{hd;}`pGG)bicWOC;{b;x zIg~{Dp+iOCL^#z0l6 Yj$e z+B{OYlfF#dvq)r{XBK2CK&mT?0ouHaxKrmHy7C*I?LOs@=???+6%bhaTWIcdaIF4$ z60-drEMz7uO<$P`wENO=GakkIstnH#e-4E0y3(jeX2UuHBwThBQ(s+x>^LWfaAKu; zR58$T-pb{C=Fr!adUghZ6S$uT7-}nEogez~xN)(D7q!UF3n2+SXqw?=1JD^9&Ep|T z46iVrU7_&_{F{x2IvlJkEQQBUW*UB@AiKh|5(H^dLp=lNiYVd<(j5jg%d W0TAi8^cKu-ETBDD`41I2~SkW zG``j$vDf7Z;u5K`#RgzMv+~5hIE<|zFWe1q82=ysCX72A_qiW`wk+1v=2MOPG6XtT znPzJD7vkcg`E#fem&v2sy$2ExoqySA>I{YVKvVeh^-NP&WOWZL3%bxKHFd`bdxAw1 z3oQ;4_J$WesT{i49$>~n;P{(p{$h8mxhJU_{|y$pbhmjIpDM&B)A>uJ5;Gygi;&8J zF84Q@iP>;MnuNbhW14#dKdrhghf0`IGpSfeNVoDOV-7R9)Qgw_PF$G`uuv-C#5?r+ zjqF%UUu`w g0&OgJ1m&?GAalEBoA5#Dx~9L{^0;N2^cPXeqJb^%hqkF8@4kw7*!EjZw&_qr zUu6n#C-<3pCKA<$%!2I%tlHQyqCQj+uyfvN uPuk|ei&%yzI(dqB^uZbzGmko zq5A8vu)VNbc7Cd;zn%{4MLe_%GQ6n`J(i&>O?Ds~L2Z-(`%%MoVF8NTEQiTsSM8!= z5w*n%$Upm9^sv->00V|AJ`Z%vRv-r2{e+6RYmT{E6mOt21bzU$<(O}%PX|W}4-gL> z3mES~Ts&NPv&pfDLk!|mgv#V$#}WlKNX&ZgUlCHrGD9>-DiW&Foel}hn?@;ztM3Fl zSGWjTKU%2HycSq_rkXZ@g==zdIi)Ki8jUX0 pGM* FxndmMNqbLVvZZT7XU?Ap &N*bUuz`Z)T=HlYuZ}Y zeygzWRpG1!El$hZvwt_r|DUA)f2P^*T~hxSS{;~Hd~tr+?PVcn7nJ|s>;C_U{Qs+x z|L@EFzbF6WpvwOv`u|U<{6DMo|De(TQ%3) -*Q=zkmP#{rBIW-~a#rXBY*eApi>j9S{SQ7Z^Co85VNLyhu55pgBO~OvC~f z#cpY{ECY**BaPhhCQ>pg29KJ!Bn{a9%_wkcX=G%c&GEuP=}@Brb9|1$N5+HAjczst z8j1@KOm5T;TJVE`@%RBbMU#dF2@eyvm28Yu5{d%cC(23`Dey2XaN<#PIHVNGq{?}y Jk&%(X8US2;)^z{? diff --git a/web/pgadmin/static/vendor/slickgrid/images/row-over-bg.gif b/web/pgadmin/static/vendor/slickgrid/images/row-over-bg.gif deleted file mode 100644 index b288e38739ad9914b73eb32837303a11a37f354a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 823 zcmV-71IYYGNk%w1VF3Ug0EYko000010RaL60s{jB1Ox;H1qB8M1_uWR2nYxX2?+`c z3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@ dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1 lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r_{{R2~A^8LV00930EC2ui0096U000OS0Po$iSC8I2dGX-ATgb4XLx%wY06VC` Bj$r@* diff --git a/web/pgadmin/static/vendor/slickgrid/images/sort-asc.gif b/web/pgadmin/static/vendor/slickgrid/images/sort-asc.gif deleted file mode 100644 index 67a2a4c669fc5821a07fc486228d626e16d6ad9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 830 zcmZ?wbhEHb j$14`E {N%eP R51)aOh^MQc%Q~loCIDZo7(W02 diff --git a/web/pgadmin/static/vendor/slickgrid/images/tag_red.png b/web/pgadmin/static/vendor/slickgrid/images/tag_red.png deleted file mode 100644 index d290fcd791ec801429fc32f166878c1f22c7e8ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 537 zcmV+!0_OdRP) 9$ZJdfg>dNa3k@+gX b+5WI?DVQXrenz6(((GBwjQDwIm4il%AcoXa`^^Z7hdsnkJ; zLQ~B~VP1>K fzL Pemr z1_MfgSS+>!QN)h=QW&U-F$O*tlO1;O+i&0xcVJhS7Np IU!??8IJ9;JZa@0Sos$>nmY*ioO0=@QcIVtsi5e!m5AT!1AL z^1RdOPzrdx-V gr+2wLc^FaV991g3& zU{I%@Xg)ESMSaKoE`SsW1Z?7_b^2gkvC1LyQ2@#3^VvKek4|Q%)46B gXv&DUBPdr>$12LrM(Cr5I|C#1xbu5|>)lhG!5j zp}PE)Xu^dU5*Pp7zt-OS+iME|2>$W}|8AgOYvNm$>YcwbP^~udrei(&4_HX}D(*)H z%3uROc+`d2dpEo{R_M0WsPGioz9m+yNO|L-4%2ZLrs7U?ZnvV+TZ|HikV=0tUa~cY zGp6UWSiUUfQ!P)%oCw4mZ qj-Bh8>RhTHU=Tm8j{pZ@+-cb9aFU(;&HV(~}EJ0um$rdG3hCK$ps2$#04jmf` zl#YuMVp|^dVU0Z}noRv+8_ZV&n0xTR8@9rDq=V^1kBP7a?pq6(bva6$!k0qpM{#-t zW=Bqw$}olWZ*%&iHn<{YxWZ;=)>=}qk|Hjb`Z7oa7A;$lpnJC+?#L({H^XQP%0OTx zMV1`uTS=76SJQPfm84|_)GN&(u#&>jZ0bi*Ci|t!C&VDIo(s&`8Na#(0*lTc$;$Yb aYkUR1qNzMm3Ij+00000 phCpI> 2{dBys(sIwpFWDz^b5`?95CI)&S&yhXMcq diff --git a/web/pgadmin/static/vendor/slickgrid/images/user_identity_plus.gif b/web/pgadmin/static/vendor/slickgrid/images/user_identity_plus.gif deleted file mode 100644 index b276a81c786561a82422555b598bbc07e63bf82b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 546 zcmZ?wbhEHb !lchi~8b7yvx zhlk4?-L>w+!;3T8%cr#zy}WUJPJ8K&IgO7`ZD`I3>n%>ZR_fBqWElN7JYt`JY zvd_2nAK0?|(~Z5KA6>k%Ywn`{iZi J$v>W7x^ZI1k2m*@ZCy08t@!iZBj>ivKDus3QITp r{ordpS$wvCCZh^f8h0exu+Lk$Bh>jMgM zY_{C4H(guY@7{B9dwAQ^-Q(GF_Xm%jK7af2_1kx^T;F{3c<=V*+cWo;Mh0sD^HazS diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js deleted file mode 100644 index ffa93e0d..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.autotooltips.js +++ /dev/null @@ -1,83 +0,0 @@ -(function ($) { - // Register namespace - $.extend(true, window, { - "Slick": { - "AutoTooltips": AutoTooltips - } - }); - - /** - * AutoTooltips plugin to show/hide tooltips when columns are too narrow to fit content. - * @constructor - * @param {boolean} [options.enableForCells=true] - Enable tooltip for grid cells - * @param {boolean} [options.enableForHeaderCells=false] - Enable tooltip for header cells - * @param {number} [options.maxToolTipLength=null] - The maximum length for a tooltip - */ - function AutoTooltips(options) { - var _grid; - var _self = this; - var _defaults = { - enableForCells: true, - enableForHeaderCells: false, - maxToolTipLength: null - }; - - /** - * Initialize plugin. - */ - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _grid = grid; - if (options.enableForCells) _grid.onMouseEnter.subscribe(handleMouseEnter); - if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.subscribe(handleHeaderMouseEnter); - } - - /** - * Destroy plugin. - */ - function destroy() { - 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 - */ - function handleMouseEnter(e) { - var cell = _grid.getCellFromEvent(e); - if (cell) { - var $node = $(_grid.getCellNode(cell.row, cell.cell)); - var text; - if ($node.innerWidth() < $node[0].scrollWidth) { - text = $.trim($node.text()); - if (options.maxToolTipLength && text.length > options.maxToolTipLength) { - text = text.substr(0, options.maxToolTipLength - 3) + "..."; - } - } else { - text = ""; - } - $node.attr("title", text); - } - } - - /** - * Handle mouse entering header cell to add/remove tooltip. - * @param {jQuery.Event} e - The event - * @param {object} args.column - The column definition - */ - function handleHeaderMouseEnter(e, args) { - var column = args.column, - $node = $(e.target).closest(".slick-header-column"); - if (column && !column.toolTip) { - $node.attr("title", ($node.innerWidth() < $node[0].scrollWidth) ? column.name : ""); - } - } - - // Public API - $.extend(this, { - "init": init, - "destroy": destroy - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js deleted file mode 100644 index 66c2376c..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellcopymanager.js +++ /dev/null @@ -1,88 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellCopyManager": CellCopyManager - } - }); - - - function CellCopyManager() { - var _grid; - var _self = this; - var _copiedRanges; - - function init(grid) { - _grid = grid; - _grid.onKeyDown.subscribe(handleKeyDown); - } - - function destroy() { - _grid.onKeyDown.unsubscribe(handleKeyDown); - } - - function handleKeyDown(e, args) { - var ranges; - if (!_grid.getEditorLock().isActive()) { - if (e.which == $.ui.keyCode.ESCAPE) { - if (_copiedRanges) { - e.preventDefault(); - clearCopySelection(); - _self.onCopyCancelled.notify({ranges: _copiedRanges}); - _copiedRanges = null; - } - } - - if (e.which == 67 && (e.ctrlKey || e.metaKey)) { - ranges = _grid.getSelectionModel().getSelectedRanges(); - if (ranges.length != 0) { - e.preventDefault(); - _copiedRanges = ranges; - markCopySelection(ranges); - _self.onCopyCells.notify({ranges: ranges}); - } - } - - if (e.which == 86 && (e.ctrlKey || e.metaKey)) { - if (_copiedRanges) { - e.preventDefault(); - ranges = _grid.getSelectionModel().getSelectedRanges(); - _self.onPasteCells.notify({from: _copiedRanges, to: ranges}); - if (!_grid.getOptions().preserveCopiedSelectionOnPaste) { - clearCopySelection(); - _copiedRanges = null; - } - } - } - } - } - - function markCopySelection(ranges) { - 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++) { - hash[j][columns[k].id] = "copied"; - } - } - } - _grid.setCellCssStyles("copy-manager", hash); - } - - function clearCopySelection() { - _grid.removeCellCssStyles("copy-manager"); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "clearCopySelection": clearCopySelection, - - "onCopyCells": new Slick.Event(), - "onCopyCancelled": new Slick.Event(), - "onPasteCells": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js deleted file mode 100644 index fec7cb2a..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellexternalcopymanager.js +++ /dev/null @@ -1,449 +0,0 @@ -(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 ", {css: options.selectionCss}) - .addClass(options.selectionCssClass) - .css("position", "absolute") - .appendTo(grid.getCanvasNode()); - } - - var from = grid.getCellNodeBox(range.fromRow, range.fromCell); - var to = grid.getCellNodeBox(range.toRow, range.toCell); - - _elem.css({ - top: from.top - 1, - left: from.left - 1, - height: to.bottom - from.top - 2, - width: to.right - from.left - 2 - }); - - return _elem; - } - - function hide() { - if (_elem) { - _elem.remove(); - _elem = null; - } - } - - $.extend(this, { - "show": show, - "hide": hide - }); - } -})(jQuery); diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellrangeselector.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellrangeselector.js deleted file mode 100644 index 8d97d6bf..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellrangeselector.js +++ /dev/null @@ -1,120 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellRangeSelector": CellRangeSelector - } - }); - - - function CellRangeSelector(options) { - var _grid; - var _canvas; - var _currentlySelectedRange; - var _dragging; - var _decorator; - var _self = this; - var _handler = new Slick.EventHandler(); - var _defaults = { - selectionCss: { - "border": "2px dashed blue" - } - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _decorator = new Slick.CellRangeDecorator(grid, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _handler - .subscribe(_grid.onDragInit, handleDragInit) - .subscribe(_grid.onDragStart, handleDragStart) - .subscribe(_grid.onDrag, handleDrag) - .subscribe(_grid.onDragEnd, handleDragEnd); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { - if (_grid.canCellBeSelected(cell.row, cell.cell)) { - _dragging = true; - e.stopImmediatePropagation(); - } - } - if (!_dragging) { - return; - } - - _grid.focus(); - - var start = _grid.getCellFromPoint( - dd.startX - $(_canvas).offset().left, - dd.startY - $(_canvas).offset().top); - - dd.range = {start: start, end: {}}; - _currentlySelectedRange = dd.range; - return _decorator.show(new Slick.Range(start.row, start.cell)); - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - e.stopImmediatePropagation(); - - var end = _grid.getCellFromPoint( - e.pageX - $(_canvas).offset().left, - e.pageY - $(_canvas).offset().top); - - if (!_grid.canCellBeSelected(end.row, end.cell)) { - return; - } - - dd.range.end = end; - _currentlySelectedRange = dd.range; - _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - - _dragging = false; - e.stopImmediatePropagation(); - - _decorator.hide(); - _self.onCellRangeSelected.notify({ - range: new Slick.Range( - dd.range.start.row, - dd.range.start.cell, - dd.range.end.row, - dd.range.end.cell - ) - }); - } - - function getCurrentRange() { - return _currentlySelectedRange; - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "getCurrentRange": getCurrentRange, - - "onBeforeCellRangeSelected": new Slick.Event(), - "onCellRangeSelected": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellselectionmodel.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellselectionmodel.js deleted file mode 100644 index 47cb0cf6..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.cellselectionmodel.js +++ /dev/null @@ -1,159 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellSelectionModel": CellSelectionModel - } - }); - - - function CellSelectionModel(options) { - var _grid; - var _canvas; - var _ranges = []; - var _self = this; - var _selector = new Slick.CellRangeSelector({ - "selectionCss": { - "border": "2px solid black" - } - }); - var _options; - var _defaults = { - selectActiveCell: true - }; - - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onActiveCellChanged.subscribe(handleActiveCellChange); - _grid.onKeyDown.subscribe(handleKeyDown); - grid.registerPlugin(_selector); - _selector.onCellRangeSelected.subscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected); - } - - function destroy() { - _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange); - _grid.onKeyDown.unsubscribe(handleKeyDown); - _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected); - _grid.unregisterPlugin(_selector); - } - - function removeInvalidRanges(ranges) { - var result = []; - - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) { - result.push(r); - } - } - - return result; - } - - function setSelectedRanges(ranges) { - // simple check for: empty selection didn't change, prevent firing onSelectedRangesChanged - if ((!_ranges || _ranges.length === 0) && (!ranges || ranges.length === 0)) { return; } - - _ranges = removeInvalidRanges(ranges); - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleBeforeCellRangeSelected(e, args) { - if (_grid.getEditorLock().isActive()) { - e.stopPropagation(); - return false; - } - } - - function handleCellRangeSelected(e, args) { - _grid.setActiveCell(args.range.fromRow, args.range.fromCell, false, false, true); - setSelectedRanges([args.range]); - } - - function handleActiveCellChange(e, args) { - if (_options.selectActiveCell && args.row != null && args.cell != null) { - setSelectedRanges([new Slick.Range(args.row, args.cell)]); - } - } - - function handleKeyDown(e) { - /*** - * Кey codes - * 37 left - * 38 up - * 39 right - * 40 down - */ - var ranges, last; - var active = _grid.getActiveCell(); - var metaKey = e.ctrlKey || e.metaKey; - - if ( active && e.shiftKey && !metaKey && !e.altKey && - (e.which == 37 || e.which == 39 || e.which == 38 || e.which == 40) ) { - - ranges = getSelectedRanges(); - if (!ranges.length) - ranges.push(new Slick.Range(active.row, active.cell)); - - // keyboard can work with last range only - last = ranges.pop(); - - // can't handle selection out of active cell - if (!last.contains(active.row, active.cell)) - last = new Slick.Range(active.row, active.cell); - - var dRow = last.toRow - last.fromRow, - dCell = last.toCell - last.fromCell, - // walking direction - dirRow = active.row == last.fromRow ? 1 : -1, - dirCell = active.cell == last.fromCell ? 1 : -1; - - if (e.which == 37) { - dCell -= dirCell; - } else if (e.which == 39) { - dCell += dirCell ; - } else if (e.which == 38) { - dRow -= dirRow; - } else if (e.which == 40) { - dRow += dirRow; - } - - // define new selection range - var new_last = new Slick.Range(active.row, active.cell, active.row + dirRow*dRow, active.cell + dirCell*dCell); - if (removeInvalidRanges([new_last]).length) { - ranges.push(new_last); - var viewRow = dirRow > 0 ? new_last.toRow : new_last.fromRow; - var viewCell = dirCell > 0 ? new_last.toCell : new_last.fromCell; - _grid.scrollRowIntoView(viewRow); - _grid.scrollCellIntoView(viewRow, viewCell); - } - else - ranges.push(last); - - setSelectedRanges(ranges); - - e.preventDefault(); - e.stopPropagation(); - } - } - - $.extend(this, { - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - - "init": init, - "destroy": destroy, - - "onSelectedRangesChanged": new Slick.Event() - }); - } -})(jQuery); diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.checkboxselectcolumn.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.checkboxselectcolumn.js deleted file mode 100644 index 83d8d500..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.checkboxselectcolumn.js +++ /dev/null @@ -1,153 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CheckboxSelectColumn": CheckboxSelectColumn - } - }); - - - function CheckboxSelectColumn(options) { - var _grid; - var _self = this; - var _handler = new Slick.EventHandler(); - var _selectedRowsLookup = {}; - var _defaults = { - columnId: "_checkbox_selector", - cssClass: null, - toolTip: "Select/Deselect All", - width: 30 - }; - - var _options = $.extend(true, {}, _defaults, options); - - function init(grid) { - _grid = grid; - _handler - .subscribe(_grid.onSelectedRowsChanged, handleSelectedRowsChanged) - .subscribe(_grid.onClick, handleClick) - .subscribe(_grid.onHeaderClick, handleHeaderClick) - .subscribe(_grid.onKeyDown, handleKeyDown); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function handleSelectedRowsChanged(e, args) { - var selectedRows = _grid.getSelectedRows(); - var lookup = {}, row, i; - for (i = 0; i < selectedRows.length; i++) { - row = selectedRows[i]; - lookup[row] = true; - if (lookup[row] !== _selectedRowsLookup[row]) { - _grid.invalidateRow(row); - delete _selectedRowsLookup[row]; - } - } - for (i in _selectedRowsLookup) { - _grid.invalidateRow(i); - } - _selectedRowsLookup = lookup; - _grid.render(); - - if (selectedRows.length && selectedRows.length == _grid.getDataLength()) { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } else { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } - } - - function handleKeyDown(e, args) { - if (e.which == 32) { - if (_grid.getColumns()[args.cell].id === _options.columnId) { - // if editing, try to commit - if (!_grid.getEditorLock().isActive() || _grid.getEditorLock().commitCurrentEdit()) { - toggleRowSelection(args.row); - } - e.preventDefault(); - e.stopImmediatePropagation(); - } - } - } - - function handleClick(e, args) { - // clicking on a row select checkbox - if (_grid.getColumns()[args.cell].id === _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - toggleRowSelection(args.row); - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function toggleRowSelection(row) { - if (_selectedRowsLookup[row]) { - _grid.setSelectedRows($.grep(_grid.getSelectedRows(), function (n) { - return n != row - })); - } else { - _grid.setSelectedRows(_grid.getSelectedRows().concat(row)); - } - } - - function handleHeaderClick(e, args) { - if (args.column.id == _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - if ($(e.target).is(":checked")) { - var rows = []; - for (var i = 0; i < _grid.getDataLength(); i++) { - rows.push(i); - } - _grid.setSelectedRows(rows); - } else { - _grid.setSelectedRows([]); - } - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function getColumnDefinition() { - return { - id: _options.columnId, - name: "", - toolTip: _options.toolTip, - field: "sel", - width: _options.width, - resizable: false, - sortable: false, - cssClass: _options.cssClass, - formatter: checkboxSelectionFormatter - }; - } - - function checkboxSelectionFormatter(row, cell, value, columnDef, dataContext) { - if (dataContext) { - return _selectedRowsLookup[row] - ? "" - : ""; - } - return null; - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "getColumnDefinition": getColumnDefinition - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.css b/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.css deleted file mode 100644 index 0ba79ea0..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.css +++ /dev/null @@ -1,39 +0,0 @@ -.slick-column-name, -.slick-sort-indicator { - /** - * This makes all "float:right" elements after it that spill over to the next line - * display way below the lower boundary of the column thus hiding them. - */ - display: inline-block; - float: left; - margin-bottom: 100px; -} - -.slick-header-button { - display: inline-block; - float: right; - vertical-align: top; - margin: 1px; - /** - * This makes all "float:right" elements after it that spill over to the next line - * display way below the lower boundary of the column thus hiding them. - */ - margin-bottom: 100px; - height: 15px; - width: 15px; - background-repeat: no-repeat; - background-position: center center; - cursor: pointer; -} - -.slick-header-button-hidden { - width: 0; - - -webkit-transition: 0.2s width; - -ms-transition: 0.2s width; - transition: 0.2s width; -} - -.slick-header-column:hover > .slick-header-button { - width: 15px; -} \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.js deleted file mode 100644 index d7c06195..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headerbuttons.js +++ /dev/null @@ -1,177 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Plugins": { - "HeaderButtons": HeaderButtons - } - } - }); - - - /*** - * A plugin to add custom buttons to column headers. - * - * USAGE: - * - * Add the plugin .js & .css files and register it with the grid. - * - * To specify a custom button in a column header, extend the column definition like so: - * - * var columns = [ - * { - * id: 'myColumn', - * name: 'My column', - * - * // This is the relevant part - * header: { - * buttons: [ - * { - * // button options - * }, - * { - * // button options - * } - * ] - * } - * } - * ]; - * - * Available button options: - * cssClass: CSS class to add to the button. - * image: Relative button image path. - * tooltip: Button tooltip. - * showOnHover: Only show the button on hover. - * handler: Button click handler. - * command: A command identifier to be passed to the onCommand event handlers. - * - * The plugin exposes the following events: - * onCommand: Fired on button click for buttons with 'command' specified. - * Event args: - * grid: Reference to the grid. - * column: Column definition. - * command: Button command identified. - * button: Button options. Note that you can change the button options in your - * event handler, and the column header will be automatically updated to - * reflect them. This is useful if you want to implement something like a - * toggle button. - * - * - * @param options {Object} Options: - * buttonCssClass: a CSS class to use for buttons (default 'slick-header-button') - * @class Slick.Plugins.HeaderButtons - * @constructor - */ - function HeaderButtons(options) { - var _grid; - var _self = this; - var _handler = new Slick.EventHandler(); - var _defaults = { - buttonCssClass: "slick-header-button" - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _grid = grid; - _handler - .subscribe(_grid.onHeaderCellRendered, handleHeaderCellRendered) - .subscribe(_grid.onBeforeHeaderCellDestroy, handleBeforeHeaderCellDestroy); - - // Force the grid to re-render the header now that the events are hooked up. - _grid.setColumns(_grid.getColumns()); - } - - - function destroy() { - _handler.unsubscribeAll(); - } - - - function handleHeaderCellRendered(e, args) { - var column = args.column; - - if (column.header && column.header.buttons) { - // Append buttons in reverse order since they are floated to the right. - var i = column.header.buttons.length; - while (i--) { - var button = column.header.buttons[i]; - var btn = $("") - .addClass(options.buttonCssClass) - .data("column", column) - .data("button", button); - - if (button.showOnHover) { - btn.addClass("slick-header-button-hidden"); - } - - if (button.image) { - btn.css("backgroundImage", "url(" + button.image + ")"); - } - - if (button.cssClass) { - btn.addClass(button.cssClass); - } - - if (button.tooltip) { - btn.attr("title", button.tooltip); - } - - if (button.command) { - btn.data("command", button.command); - } - - if (button.handler) { - btn.on("click", button.handler); - } - - btn - .on("click", handleButtonClick) - .appendTo(args.node); - } - } - } - - - function handleBeforeHeaderCellDestroy(e, args) { - var column = args.column; - - if (column.header && column.header.buttons) { - // Removing buttons via jQuery will also clean up any event handlers and data. - // NOTE: If you attach event handlers directly or using a different framework, - // you must also clean them up here to avoid memory leaks. - $(args.node).find("." + options.buttonCssClass).remove(); - } - } - - - function handleButtonClick(e) { - var command = $(this).data("command"); - var columnDef = $(this).data("column"); - var button = $(this).data("button"); - - if (command != null) { - _self.onCommand.notify({ - "grid": _grid, - "column": columnDef, - "command": command, - "button": button - }, e, _self); - - // Update the header in case the user updated the button definition in the handler. - _grid.updateColumnHeader(columnDef.id); - } - - // Stop propagation so that it doesn't register as a header click event. - e.preventDefault(); - e.stopPropagation(); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "onCommand": new Slick.Event() - }); - } -})(jQuery); diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.css b/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.css deleted file mode 100644 index 8b0b6a9f..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.css +++ /dev/null @@ -1,59 +0,0 @@ -/* Menu button */ -.slick-header-menubutton { - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 14px; - background-repeat: no-repeat; - background-position: left center; - background-image: url(../images/down.gif); - cursor: pointer; - - display: none; - border-left: thin ridge silver; -} - -.slick-header-column:hover > .slick-header-menubutton, -.slick-header-column-active .slick-header-menubutton { - display: inline-block; -} - -/* Menu */ -.slick-header-menu { - position: absolute; - display: inline-block; - margin: 0; - padding: 2px; - cursor: default; -} - - -/* Menu items */ -.slick-header-menuitem { - list-style: none; - margin: 0; - padding: 0; - cursor: pointer; -} - -.slick-header-menuicon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - margin-right: 4px; - background-repeat: no-repeat; - background-position: center center; -} - -.slick-header-menucontent { - display: inline-block; - vertical-align: middle; -} - - -/* Disabled */ -.slick-header-menuitem-disabled { - color: silver; -} diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.js deleted file mode 100644 index c4032301..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.headermenu.js +++ /dev/null @@ -1,275 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Plugins": { - "HeaderMenu": HeaderMenu - } - } - }); - - - /*** - * A plugin to add drop-down menus to column headers. - * - * USAGE: - * - * Add the plugin .js & .css files and register it with the grid. - * - * To specify a menu in a column header, extend the column definition like so: - * - * var columns = [ - * { - * id: 'myColumn', - * name: 'My column', - * - * // This is the relevant part - * header: { - * menu: { - * items: [ - * { - * // menu item options - * }, - * { - * // menu item options - * } - * ] - * } - * } - * } - * ]; - * - * - * Available menu options: - * tooltip: Menu button tooltip. - * - * - * Available menu item options: - * title: Menu item text. - * disabled: Whether the item is disabled. - * tooltip: Item tooltip. - * command: A command identifier to be passed to the onCommand event handlers. - * iconCssClass: A CSS class to be added to the menu item icon. - * iconImage: A url to the icon image. - * - * - * The plugin exposes the following events: - * onBeforeMenuShow: Fired before the menu is shown. You can customize the menu or dismiss it by returning false. - * Event args: - * grid: Reference to the grid. - * column: Column definition. - * menu: Menu options. Note that you can change the menu items here. - * - * onCommand: Fired on menu item click for buttons with 'command' specified. - * Event args: - * grid: Reference to the grid. - * column: Column definition. - * command: Button command identified. - * button: Button options. Note that you can change the button options in your - * event handler, and the column header will be automatically updated to - * reflect them. This is useful if you want to implement something like a - * toggle button. - * - * - * @param options {Object} Options: - * buttonCssClass: an extra CSS class to add to the menu button - * buttonImage: a url to the menu button image (default '../images/down.gif') - * @class Slick.Plugins.HeaderButtons - * @constructor - */ - function HeaderMenu(options) { - var _grid; - var _self = this; - var _handler = new Slick.EventHandler(); - var _defaults = { - buttonCssClass: null, - buttonImage: null - }; - var $menu; - var $activeHeaderColumn; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _grid = grid; - _handler - .subscribe(_grid.onHeaderCellRendered, handleHeaderCellRendered) - .subscribe(_grid.onBeforeHeaderCellDestroy, handleBeforeHeaderCellDestroy); - - // Force the grid to re-render the header now that the events are hooked up. - _grid.setColumns(_grid.getColumns()); - - // Hide the menu on outside click. - $(document.body).on("mousedown", handleBodyMouseDown); - } - - - function destroy() { - _handler.unsubscribeAll(); - $(document.body).off("mousedown", handleBodyMouseDown); - } - - - function handleBodyMouseDown(e) { - if ($menu && $menu[0] != e.target && !$.contains($menu[0], e.target)) { - hideMenu(); - } - } - - - function hideMenu() { - if ($menu) { - $menu.remove(); - $menu = null; - $activeHeaderColumn - .removeClass("slick-header-column-active"); - } - } - - function handleHeaderCellRendered(e, args) { - var column = args.column; - var menu = column.header && column.header.menu; - - if (menu) { - var $el = $("") - .addClass("slick-header-menubutton") - .data("column", column) - .data("menu", menu); - - if (options.buttonCssClass) { - $el.addClass(options.buttonCssClass); - } - - if (options.buttonImage) { - $el.css("background-image", "url(" + options.buttonImage + ")"); - } - - if (menu.tooltip) { - $el.attr("title", menu.tooltip); - } - - $el - .on("click", showMenu) - .appendTo(args.node); - } - } - - - function handleBeforeHeaderCellDestroy(e, args) { - var column = args.column; - - if (column.header && column.header.menu) { - $(args.node).find(".slick-header-menubutton").remove(); - } - } - - - function showMenu(e) { - var $menuButton = $(this); - var menu = $menuButton.data("menu"); - var columnDef = $menuButton.data("column"); - - // Let the user modify the menu or cancel altogether, - // or provide alternative menu implementation. - if (_self.onBeforeMenuShow.notify({ - "grid": _grid, - "column": columnDef, - "menu": menu - }, e, _self) == false) { - return; - } - - - if (!$menu) { - $menu = $("") - .appendTo(_grid.getContainerNode()); - } - $menu.empty(); - - - // Construct the menu items. - for (var i = 0; i < menu.items.length; i++) { - var item = menu.items[i]; - - var $li = $("") - .data("command", item.command || '') - .data("column", columnDef) - .data("item", item) - .on("click", handleMenuItemClick) - .appendTo($menu); - - if (item.disabled) { - $li.addClass("slick-header-menuitem-disabled"); - } - - if (item.tooltip) { - $li.attr("title", item.tooltip); - } - - var $icon = $("") - .appendTo($li); - - if (item.iconCssClass) { - $icon.addClass(item.iconCssClass); - } - - if (item.iconImage) { - $icon.css("background-image", "url(" + item.iconImage + ")"); - } - - $("") - .text(item.title) - .appendTo($li); - } - - - // Position the menu. - $menu - .offset({ top: $(this).offset().top + $(this).height(), left: $(this).offset().left }); - - - // Mark the header as active to keep the highlighting. - $activeHeaderColumn = $menuButton.closest(".slick-header-column"); - $activeHeaderColumn - .addClass("slick-header-column-active"); - - // Stop propagation so that it doesn't register as a header click event. - e.preventDefault(); - e.stopPropagation(); - } - - - function handleMenuItemClick(e) { - var command = $(this).data("command"); - var columnDef = $(this).data("column"); - var item = $(this).data("item"); - - if (item.disabled) { - return; - } - - hideMenu(); - - if (command != null && command != '') { - _self.onCommand.notify({ - "grid": _grid, - "column": columnDef, - "command": command, - "item": item - }, e, _self); - } - - // Stop propagation so that it doesn't register as a header click event. - e.preventDefault(); - e.stopPropagation(); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "onBeforeMenuShow": new Slick.Event(), - "onCommand": new Slick.Event() - }); - } -})(jQuery); diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowmovemanager.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowmovemanager.js deleted file mode 100644 index 5f87a1ed..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowmovemanager.js +++ /dev/null @@ -1,138 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "RowMoveManager": RowMoveManager - } - }); - - function RowMoveManager(options) { - var _grid; - var _canvas; - var _dragging; - var _self = this; - var _handler = new Slick.EventHandler(); - var _defaults = { - cancelEditOnDrag: false - }; - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _handler - .subscribe(_grid.onDragInit, handleDragInit) - .subscribe(_grid.onDragStart, handleDragStart) - .subscribe(_grid.onDrag, handleDrag) - .subscribe(_grid.onDragEnd, handleDragEnd); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - - if (options.cancelEditOnDrag && _grid.getEditorLock().isActive()) { - _grid.getEditorLock().cancelCurrentEdit(); - } - - if (_grid.getEditorLock().isActive() || !/move|selectAndMove/.test(_grid.getColumns()[cell.cell].behavior)) { - return false; - } - - _dragging = true; - e.stopImmediatePropagation(); - - var selectedRows = _grid.getSelectedRows(); - - if (selectedRows.length == 0 || $.inArray(cell.row, selectedRows) == -1) { - selectedRows = [cell.row]; - _grid.setSelectedRows(selectedRows); - } - - var rowHeight = _grid.getOptions().rowHeight; - - dd.selectedRows = selectedRows; - - dd.selectionProxy = $("") - .css("position", "absolute") - .css("zIndex", "99999") - .css("width", $(_canvas).innerWidth()) - .css("height", rowHeight * selectedRows.length) - .appendTo(_canvas); - - dd.guide = $("") - .css("position", "absolute") - .css("zIndex", "99998") - .css("width", $(_canvas).innerWidth()) - .css("top", -1000) - .appendTo(_canvas); - - dd.insertBefore = -1; - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - - e.stopImmediatePropagation(); - - var top = e.pageY - $(_canvas).offset().top; - dd.selectionProxy.css("top", top - 5); - - var insertBefore = Math.max(0, Math.min(Math.round(top / _grid.getOptions().rowHeight), _grid.getDataLength())); - if (insertBefore !== dd.insertBefore) { - var eventData = { - "rows": dd.selectedRows, - "insertBefore": insertBefore - }; - - if (_self.onBeforeMoveRows.notify(eventData) === false) { - dd.guide.css("top", -1000); - dd.canMove = false; - } else { - dd.guide.css("top", insertBefore * _grid.getOptions().rowHeight); - dd.canMove = true; - } - - dd.insertBefore = insertBefore; - } - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - _dragging = false; - e.stopImmediatePropagation(); - - dd.guide.remove(); - dd.selectionProxy.remove(); - - if (dd.canMove) { - var eventData = { - "rows": dd.selectedRows, - "insertBefore": dd.insertBefore - }; - // TODO: _grid.remapCellCssClasses ? - _self.onMoveRows.notify(eventData); - } - } - - $.extend(this, { - "onBeforeMoveRows": new Slick.Event(), - "onMoveRows": new Slick.Event(), - - "init": init, - "destroy": destroy - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowselectionmodel.js b/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowselectionmodel.js deleted file mode 100644 index 95c12ab5..00000000 --- a/web/pgadmin/static/vendor/slickgrid/plugins/slick.rowselectionmodel.js +++ /dev/null @@ -1,189 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "RowSelectionModel": RowSelectionModel - } - }); - - function RowSelectionModel(options) { - var _grid; - var _ranges = []; - var _self = this; - var _handler = new Slick.EventHandler(); - var _inHandler; - var _options; - var _defaults = { - selectActiveRow: true - }; - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _handler.subscribe(_grid.onActiveCellChanged, - wrapHandler(handleActiveCellChange)); - _handler.subscribe(_grid.onKeyDown, - wrapHandler(handleKeyDown)); - _handler.subscribe(_grid.onClick, - wrapHandler(handleClick)); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function wrapHandler(handler) { - return function () { - if (!_inHandler) { - _inHandler = true; - handler.apply(this, arguments); - _inHandler = false; - } - }; - } - - function rangesToRows(ranges) { - var rows = []; - for (var i = 0; i < ranges.length; i++) { - for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { - rows.push(j); - } - } - return rows; - } - - function rowsToRanges(rows) { - var ranges = []; - var lastCell = _grid.getColumns().length - 1; - for (var i = 0; i < rows.length; i++) { - ranges.push(new Slick.Range(rows[i], 0, rows[i], lastCell)); - } - return ranges; - } - - function getRowsRange(from, to) { - var i, rows = []; - for (i = from; i <= to; i++) { - rows.push(i); - } - for (i = to; i < from; i++) { - rows.push(i); - } - return rows; - } - - function getSelectedRows() { - return rangesToRows(_ranges); - } - - function setSelectedRows(rows) { - setSelectedRanges(rowsToRanges(rows)); - } - - function setSelectedRanges(ranges) { - // simple check for: empty selection didn't change, prevent firing onSelectedRangesChanged - if ((!_ranges || _ranges.length === 0) && (!ranges || ranges.length === 0)) { return; } - _ranges = ranges; - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleActiveCellChange(e, data) { - if (_options.selectActiveRow && data.row != null) { - setSelectedRanges([new Slick.Range(data.row, 0, data.row, _grid.getColumns().length - 1)]); - } - } - - function handleKeyDown(e) { - var activeRow = _grid.getActiveCell(); - if (activeRow && e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && (e.which == 38 || e.which == 40)) { - var selectedRows = getSelectedRows(); - selectedRows.sort(function (x, y) { - return x - y - }); - - if (!selectedRows.length) { - selectedRows = [activeRow.row]; - } - - var top = selectedRows[0]; - var bottom = selectedRows[selectedRows.length - 1]; - var active; - - if (e.which == 40) { - active = activeRow.row < bottom || top == bottom ? ++bottom : ++top; - } else { - active = activeRow.row < bottom ? --bottom : --top; - } - - if (active >= 0 && active < _grid.getDataLength()) { - _grid.scrollRowIntoView(active); - var tempRanges = rowsToRanges(getRowsRange(top, bottom)); - setSelectedRanges(tempRanges); - } - - e.preventDefault(); - e.stopPropagation(); - } - } - - function handleClick(e) { - var cell = _grid.getCellFromEvent(e); - if (!cell || !_grid.canCellBeActive(cell.row, cell.cell)) { - return false; - } - - if (!_grid.getOptions().multiSelect || ( - !e.ctrlKey && !e.shiftKey && !e.metaKey)) { - return false; - } - - var selection = rangesToRows(_ranges); - var idx = $.inArray(cell.row, selection); - - if (idx === -1 && (e.ctrlKey || e.metaKey)) { - selection.push(cell.row); - _grid.setActiveCell(cell.row, cell.cell); - } else if (idx !== -1 && (e.ctrlKey || e.metaKey)) { - selection = $.grep(selection, function (o, i) { - return (o !== cell.row); - }); - _grid.setActiveCell(cell.row, cell.cell); - } else if (selection.length && e.shiftKey) { - var last = selection.pop(); - var from = Math.min(cell.row, last); - var to = Math.max(cell.row, last); - selection = []; - for (var i = from; i <= to; i++) { - if (i !== last) { - selection.push(i); - } - } - selection.push(last); - _grid.setActiveCell(cell.row, cell.cell); - } - - var tempRanges = rowsToRanges(selection); - setSelectedRanges(tempRanges); - e.stopImmediatePropagation(); - - return true; - } - - $.extend(this, { - "getSelectedRows": getSelectedRows, - "setSelectedRows": setSelectedRows, - - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - - "init": init, - "destroy": destroy, - - "onSelectedRangesChanged": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css b/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css deleted file mode 100644 index efc74154..00000000 --- a/web/pgadmin/static/vendor/slickgrid/slick-default-theme.css +++ /dev/null @@ -1,118 +0,0 @@ -/* -IMPORTANT: -In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes. -No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS -classes should alter those! -*/ - -.slick-header-columns { - background: url('images/header-columns-bg.gif') repeat-x center bottom; - border-bottom: 1px solid silver; -} - -.slick-header-column { - background: url('images/header-columns-bg.gif') repeat-x center bottom; - border-right: 1px solid silver; -} - -.slick-header-column:hover, .slick-header-column-active { - background: white url('images/header-columns-over-bg.gif') repeat-x center bottom; -} - -.slick-headerrow { - background: #fafafa; -} - -.slick-headerrow-column { - background: #fafafa; - border-bottom: 0; - height: 100%; -} - -.slick-row.ui-state-active { - background: #F5F7D7; -} - -.slick-row { - position: absolute; - background: white; - border: 0px; - line-height: 20px; -} - -.slick-row.selected { - z-index: 10; - background: #DFE8F6; -} - -.slick-cell { - padding-left: 4px; - padding-right: 4px; -} - -.slick-group { - border-bottom: 2px solid silver; -} - -.slick-group-toggle { - width: 9px; - height: 9px; - margin-right: 5px; -} - -.slick-group-toggle.expanded { - background: url(images/collapse.gif) no-repeat center center; -} - -.slick-group-toggle.collapsed { - background: url(images/expand.gif) no-repeat center center; -} - -.slick-group-totals { - color: gray; - background: white; -} - -.slick-cell.selected { - background-color: beige; -} - -.slick-cell.active { - border-color: gray; - border-style: solid; -} - -.slick-sortable-placeholder { - background: silver !important; -} - -.slick-row.odd { - background: #fafafa; -} - -.slick-row.ui-state-active { - background: #F5F7D7; -} - -.slick-row.loading { - opacity: 0.5; - filter: alpha(opacity = 50); -} - -.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; -} - -@-moz-keyframes slickgrid-invalid-hilite { - from { box-shadow: 0 0 6px red; } - to { box-shadow: none; } -} - -@-webkit-keyframes slickgrid-invalid-hilite { - from { box-shadow: 0 0 6px red; } - to { box-shadow: none; } -} \ No newline at end of file diff --git a/web/pgadmin/static/vendor/slickgrid/slick.core.js b/web/pgadmin/static/vendor/slickgrid/slick.core.js deleted file mode 100644 index 1846a50a..00000000 --- a/web/pgadmin/static/vendor/slickgrid/slick.core.js +++ /dev/null @@ -1,485 +0,0 @@ -/*** - * Contains core SlickGrid classes. - * @module Core - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Event": Event, - "EventData": EventData, - "EventHandler": EventHandler, - "Range": Range, - "NonDataRow": NonDataItem, - "Group": Group, - "GroupTotals": GroupTotals, - "EditorLock": EditorLock, - - /*** - * A global singleton editor lock. - * @class GlobalEditorLock - * @static - * @constructor - */ - "GlobalEditorLock": new EditorLock(), - - "keyCode": { - BACKSPACE: 8, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - PAGE_DOWN: 34, - PAGE_UP: 33, - RIGHT: 39, - TAB: 9, - UP: 38 - }, - "preClickClassName" : "slick-edit-preclick" - } - }); - - /*** - * An event object for passing data to event handlers and letting them control propagation. - * This is pretty much identical to how W3C and jQuery implement events.
- * @class EventData - * @constructor - */ - function EventData() { - var isPropagationStopped = false; - var isImmediatePropagationStopped = false; - - /*** - * Stops event from propagating up the DOM tree. - * @method stopPropagation - */ - this.stopPropagation = function () { - isPropagationStopped = true; - }; - - /*** - * Returns whether stopPropagation was called on this event object. - * @method isPropagationStopped - * @return {Boolean} - */ - this.isPropagationStopped = function () { - return isPropagationStopped; - }; - - /*** - * Prevents the rest of the handlers from being executed. - * @method stopImmediatePropagation - */ - this.stopImmediatePropagation = function () { - isImmediatePropagationStopped = true; - }; - - /*** - * Returns whether stopImmediatePropagation was called on this event object.\ - * @method isImmediatePropagationStopped - * @return {Boolean} - */ - this.isImmediatePropagationStopped = function () { - return isImmediatePropagationStopped; - } - } - - /*** - * A simple publisher-subscriber implementation. - * @class Event - * @constructor - */ - function Event() { - var handlers = []; - - /*** - * Adds an event handler to be called when the event is fired. - *Event handler will receive two arguments - an
EventDataand thedata- * object the event was fired with.- * @method subscribe - * @param fn {Function} Event handler. - */ - this.subscribe = function (fn) { - handlers.push(fn); - }; - - /*** - * Removes an event handler added with
").appendTo(args.container); - $picker.append("subscribe(fn). - * @method unsubscribe - * @param fn {Function} Event handler to be removed. - */ - this.unsubscribe = function (fn) { - for (var i = handlers.length - 1; i >= 0; i--) { - if (handlers[i] === fn) { - handlers.splice(i, 1); - } - } - }; - - /*** - * Fires an event notifying all subscribers. - * @method notify - * @param args {Object} Additional data object to be passed to all handlers. - * @param e {EventData} - * Optional. - * AnEventDataobject to be passed to all handlers. - * For DOM events, an existing W3C/jQuery event object can be passed in. - * @param scope {Object} - * Optional. - * The scope ("this") within which the handler will be executed. - * If not specified, the scope will be set to theEventinstance. - */ - this.notify = function (args, e, scope) { - e = e || new EventData(); - scope = scope || this; - - var returnValue; - for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { - returnValue = handlers[i].call(scope, e, args); - } - - return returnValue; - }; - } - - function EventHandler() { - var handlers = []; - - this.subscribe = function (event, handler) { - handlers.push({ - event: event, - handler: handler - }); - event.subscribe(handler); - - return this; // allow chaining - }; - - this.unsubscribe = function (event, handler) { - var i = handlers.length; - while (i--) { - if (handlers[i].event === event && - handlers[i].handler === handler) { - handlers.splice(i, 1); - event.unsubscribe(handler); - return; - } - } - - return this; // allow chaining - }; - - this.unsubscribeAll = function () { - var i = handlers.length; - while (i--) { - handlers[i].event.unsubscribe(handlers[i].handler); - } - handlers = []; - - return this; // allow chaining - } - } - - /*** - * A structure containing a range of cells. - * @class Range - * @constructor - * @param fromRow {Integer} Starting row. - * @param fromCell {Integer} Starting cell. - * @param toRow {Integer} Optional. Ending row. Defaults tofromRow. - * @param toCell {Integer} Optional. Ending cell. Defaults tofromCell. - */ - function Range(fromRow, fromCell, toRow, toCell) { - if (toRow === undefined && toCell === undefined) { - toRow = fromRow; - toCell = fromCell; - } - - /*** - * @property fromRow - * @type {Integer} - */ - this.fromRow = Math.min(fromRow, toRow); - - /*** - * @property fromCell - * @type {Integer} - */ - this.fromCell = Math.min(fromCell, toCell); - - /*** - * @property toRow - * @type {Integer} - */ - this.toRow = Math.max(fromRow, toRow); - - /*** - * @property toCell - * @type {Integer} - */ - this.toCell = Math.max(fromCell, toCell); - - /*** - * Returns whether a range represents a single row. - * @method isSingleRow - * @return {Boolean} - */ - this.isSingleRow = function () { - return this.fromRow == this.toRow; - }; - - /*** - * Returns whether a range represents a single cell. - * @method isSingleCell - * @return {Boolean} - */ - this.isSingleCell = function () { - return this.fromRow == this.toRow && this.fromCell == this.toCell; - }; - - /*** - * Returns whether a range contains a given cell. - * @method contains - * @param row {Integer} - * @param cell {Integer} - * @return {Boolean} - */ - this.contains = function (row, cell) { - return row >= this.fromRow && row <= this.toRow && - cell >= this.fromCell && cell <= this.toCell; - }; - - /*** - * Returns a readable representation of a range. - * @method toString - * @return {String} - */ - this.toString = function () { - if (this.isSingleCell()) { - return "(" + this.fromRow + ":" + this.fromCell + ")"; - } - else { - return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; - } - } - } - - - /*** - * A base class that all special / non-data rows (like Group and GroupTotals) derive from. - * @class NonDataItem - * @constructor - */ - function NonDataItem() { - this.__nonDataRow = true; - } - - - /*** - * Information about a group of rows. - * @class Group - * @extends Slick.NonDataItem - * @constructor - */ - function Group() { - this.__group = true; - - /** - * Grouping level, starting with 0. - * @property level - * @type {Number} - */ - this.level = 0; - - /*** - * Number of rows in the group. - * @property count - * @type {Integer} - */ - this.count = 0; - - /*** - * Grouping value. - * @property value - * @type {Object} - */ - this.value = null; - - /*** - * Formatted display value of the group. - * @property title - * @type {String} - */ - this.title = null; - - /*** - * Whether a group is collapsed. - * @property collapsed - * @type {Boolean} - */ - this.collapsed = false; - - /*** - * GroupTotals, if any. - * @property totals - * @type {GroupTotals} - */ - this.totals = null; - - /** - * Rows that are part of the group. - * @property rows - * @type {Array} - */ - this.rows = []; - - /** - * Sub-groups that are part of the group. - * @property groups - * @type {Array} - */ - this.groups = null; - - /** - * A unique key used to identify the group. This key can be used in calls to DataView - * collapseGroup() or expandGroup(). - * @property groupingKey - * @type {Object} - */ - this.groupingKey = null; - } - - Group.prototype = new NonDataItem(); - - /*** - * Compares two Group instances. - * @method equals - * @return {Boolean} - * @param group {Group} Group instance to compare to. - */ - Group.prototype.equals = function (group) { - return this.value === group.value && - this.count === group.count && - this.collapsed === group.collapsed && - this.title === group.title; - }; - - /*** - * Information about group totals. - * An instance of GroupTotals will be created for each totals row and passed to the aggregators - * so that they can store arbitrary data in it. That data can later be accessed by group totals - * formatters during the display. - * @class GroupTotals - * @extends Slick.NonDataItem - * @constructor - */ - function GroupTotals() { - this.__groupTotals = true; - - /*** - * Parent Group. - * @param group - * @type {Group} - */ - this.group = null; - - /*** - * Whether the totals have been fully initialized / calculated. - * Will be set to false for lazy-calculated group totals. - * @param initialized - * @type {Boolean} - */ - this.initialized = false; - } - - GroupTotals.prototype = new NonDataItem(); - - /*** - * A locking helper to track the active edit controller and ensure that only a single controller - * can be active at a time. This prevents a whole class of state and validation synchronization - * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress - * and attempt a commit or cancel before proceeding. - * @class EditorLock - * @constructor - */ - function EditorLock() { - var activeEditController = null; - - /*** - * Returns true if a specified edit controller is active (has the edit lock). - * If the parameter is not specified, returns true if any edit controller is active. - * @method isActive - * @param editController {EditController} - * @return {Boolean} - */ - this.isActive = function (editController) { - return (editController ? activeEditController === editController : activeEditController !== null); - }; - - /*** - * Sets the specified edit controller as the active edit controller (acquire edit lock). - * If another edit controller is already active, and exception will be throw new Error(. - * @method activate - * @param editController {EditController} edit controller acquiring the lock - */ - this.activate = function (editController) { - if (editController === activeEditController) { // already activated? - return; - } - if (activeEditController !== null) { - throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"); - } - if (!editController.commitCurrentEdit) { - throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"); - } - if (!editController.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 throw new Error(. - * @method deactivate - * @param editController {EditController} edit controller releasing the lock - */ - this.deactivate = function (editController) { - if (activeEditController !== editController) { - throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"); - } - activeEditController = null; - }; - - /*** - * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit - * controller and returns whether the commit attempt was successful (commit may fail due to validation - * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded - * and false otherwise. If no edit controller is active, returns true. - * @method commitCurrentEdit - * @return {Boolean} - */ - this.commitCurrentEdit = function () { - return (activeEditController ? activeEditController.commitCurrentEdit() : true); - }; - - /*** - * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit - * controller and returns whether the edit was successfully cancelled. If no edit controller is - * active, returns true. - * @method cancelCurrentEdit - * @return {Boolean} - */ - this.cancelCurrentEdit = function cancelCurrentEdit() { - return (activeEditController ? activeEditController.cancelCurrentEdit() : true); - }; - } -})(jQuery); - - diff --git a/web/pgadmin/static/vendor/slickgrid/slick.dataview.js b/web/pgadmin/static/vendor/slickgrid/slick.dataview.js deleted file mode 100644 index b004b800..00000000 --- a/web/pgadmin/static/vendor/slickgrid/slick.dataview.js +++ /dev/null @@ -1,1159 +0,0 @@ -(function ($) { - $.extend(true, window, { - Slick: { - Data: { - DataView: DataView, - Aggregators: { - Avg: AvgAggregator, - Min: MinAggregator, - Max: MaxAggregator, - Sum: SumAggregator - } - } - } - }); - - - /*** - * A sample Model implementation. - * Provides a filtered view of the underlying data. - * - * Relies on the data item having an "id" property uniquely identifying it. - */ - function DataView(options) { - var self = this; - - var defaults = { - groupItemMetadataProvider: null, - inlineFilters: false - }; - - - // private - var idProperty = "id"; // property holding a unique row id - var items = []; // data by index - var rows = []; // data by row - var idxById = {}; // indexes by id - var rowsById = null; // rows by id; lazy-calculated - var filter = null; // filter function - var updated = null; // updated item ids - var suspend = false; // suspends the recalculation - var sortAsc = true; - var fastSortField; - var sortComparer; - var refreshHints = {}; - var prevRefreshHints = {}; - var filterArgs; - var filteredItems = []; - var compiledFilter; - var compiledFilterWithCaching; - var filterCache = []; - - // grouping - var groupingInfoDefaults = { - getter: null, - formatter: null, - comparer: function(a, b) { - return (a.value === b.value ? 0 : - (a.value > b.value ? 1 : -1) - ); - }, - predefinedValues: [], - aggregators: [], - aggregateEmpty: false, - aggregateCollapsed: false, - aggregateChildGroups: false, - collapsed: false, - displayTotalsRow: true, - lazyTotalsCalculation: false - }; - var groupingInfos = []; - var groups = []; - var toggledGroupsByLevel = []; - var groupingDelimiter = ':|:'; - - var pagesize = 0; - var pagenum = 0; - var totalRows = 0; - - // events - var onRowCountChanged = new Slick.Event(); - var onRowsChanged = new Slick.Event(); - var onPagingInfoChanged = new Slick.Event(); - - options = $.extend(true, {}, defaults, options); - - - function beginUpdate() { - suspend = true; - } - - function endUpdate() { - suspend = false; - refresh(); - } - - function setRefreshHints(hints) { - refreshHints = hints; - } - - function setFilterArgs(args) { - filterArgs = args; - } - - function updateIdxById(startingIndex) { - startingIndex = startingIndex || 0; - var id; - for (var i = startingIndex, l = items.length; i < l; i++) { - id = items[i][idProperty]; - if (id === undefined) { - throw new Error("Each data element must implement a unique 'id' property"); - } - idxById[id] = i; - } - } - - function ensureIdUniqueness() { - var id; - for (var i = 0, l = items.length; i < l; i++) { - id = items[i][idProperty]; - if (id === undefined || idxById[id] !== i) { - throw new Error("Each data element must implement a unique 'id' property"); - } - } - } - - function getItems() { - return items; - } - - function setItems(data, objectIdProperty) { - if (objectIdProperty !== undefined) { - idProperty = objectIdProperty; - } - items = filteredItems = data; - idxById = {}; - updateIdxById(); - ensureIdUniqueness(); - refresh(); - } - - function setPagingOptions(args) { - if (args.pageSize != undefined) { - pagesize = args.pageSize; - pagenum = pagesize ? Math.min(pagenum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)) : 0; - } - - if (args.pageNum != undefined) { - pagenum = Math.min(args.pageNum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)); - } - - onPagingInfoChanged.notify(getPagingInfo(), null, self); - - refresh(); - } - - function getPagingInfo() { - var totalPages = pagesize ? Math.max(1, Math.ceil(totalRows / pagesize)) : 1; - return {pageSize: pagesize, pageNum: pagenum, totalRows: totalRows, totalPages: totalPages, dataView: self}; - } - - function sort(comparer, ascending) { - sortAsc = ascending; - sortComparer = comparer; - fastSortField = null; - if (ascending === false) { - items.reverse(); - } - items.sort(comparer); - if (ascending === false) { - items.reverse(); - } - idxById = {}; - updateIdxById(); - refresh(); - } - - /*** - * Provides a workaround for the extremely slow sorting in IE. - * Does a [lexicographic] sort on a give column by temporarily overriding Object.prototype.toString - * to return the value of that field and then doing a native Array.sort(). - */ - function fastSort(field, ascending) { - sortAsc = ascending; - fastSortField = field; - sortComparer = null; - var oldToString = Object.prototype.toString; - Object.prototype.toString = (typeof field == "function") ? field : function () { - return this[field] - }; - // an extra reversal for descending sort keeps the sort stable - // (assuming a stable native sort implementation, which isn't true in some cases) - if (ascending === false) { - items.reverse(); - } - items.sort(); - Object.prototype.toString = oldToString; - if (ascending === false) { - items.reverse(); - } - idxById = {}; - updateIdxById(); - refresh(); - } - - function reSort() { - if (sortComparer) { - sort(sortComparer, sortAsc); - } else if (fastSortField) { - fastSort(fastSortField, sortAsc); - } - } - - function getFilteredItems(){ - return filteredItems; - } - - - function getFilter(){ - return filter; - } - - function setFilter(filterFn) { - filter = filterFn; - if (options.inlineFilters) { - compiledFilter = compileFilter(); - compiledFilterWithCaching = compileFilterWithCaching(); - } - refresh(); - } - - function getGrouping() { - return groupingInfos; - } - - function setGrouping(groupingInfo) { - if (!options.groupItemMetadataProvider) { - options.groupItemMetadataProvider = new Slick.Data.GroupItemMetadataProvider(); - } - - groups = []; - toggledGroupsByLevel = []; - groupingInfo = groupingInfo || []; - groupingInfos = (groupingInfo instanceof Array) ? groupingInfo : [groupingInfo]; - - for (var i = 0; i < groupingInfos.length; i++) { - var gi = groupingInfos[i] = $.extend(true, {}, groupingInfoDefaults, groupingInfos[i]); - gi.getterIsAFn = typeof gi.getter === "function"; - - // pre-compile accumulator loops - gi.compiledAccumulators = []; - var idx = gi.aggregators.length; - while (idx--) { - gi.compiledAccumulators[idx] = compileAccumulatorLoop(gi.aggregators[idx]); - } - - toggledGroupsByLevel[i] = {}; - } - - refresh(); - } - - /** - * @deprecated Please use {@link setGrouping}. - */ - function groupBy(valueGetter, valueFormatter, sortComparer) { - if (valueGetter == null) { - setGrouping([]); - return; - } - - setGrouping({ - getter: valueGetter, - formatter: valueFormatter, - comparer: sortComparer - }); - } - - /** - * @deprecated Please use {@link setGrouping}. - */ - function setAggregators(groupAggregators, includeCollapsed) { - if (!groupingInfos.length) { - throw new Error("At least one grouping must be specified before calling setAggregators()."); - } - - groupingInfos[0].aggregators = groupAggregators; - groupingInfos[0].aggregateCollapsed = includeCollapsed; - - setGrouping(groupingInfos); - } - - function getItemByIdx(i) { - return items[i]; - } - - function getIdxById(id) { - return idxById[id]; - } - - function ensureRowsByIdCache() { - if (!rowsById) { - rowsById = {}; - for (var i = 0, l = rows.length; i < l; i++) { - rowsById[rows[i][idProperty]] = i; - } - } - } - - function getRowById(id) { - ensureRowsByIdCache(); - return rowsById[id]; - } - - function getItemById(id) { - return items[idxById[id]]; - } - - function mapIdsToRows(idArray) { - var rows = []; - ensureRowsByIdCache(); - for (var i = 0, l = idArray.length; i < l; i++) { - var row = rowsById[idArray[i]]; - if (row != null) { - rows[rows.length] = row; - } - } - return rows; - } - - function mapRowsToIds(rowArray) { - var ids = []; - for (var i = 0, l = rowArray.length; i < l; i++) { - if (rowArray[i] < rows.length) { - ids[ids.length] = rows[rowArray[i]][idProperty]; - } - } - return ids; - } - - function updateItem(id, item) { - if (idxById[id] === undefined || id !== item[idProperty]) { - throw new Error("Invalid or non-matching id"); - } - items[idxById[id]] = item; - if (!updated) { - updated = {}; - } - updated[id] = true; - refresh(); - } - - function insertItem(insertBefore, item) { - items.splice(insertBefore, 0, item); - updateIdxById(insertBefore); - refresh(); - } - - function addItem(item) { - items.push(item); - updateIdxById(items.length - 1); - refresh(); - } - - function deleteItem(id) { - var idx = idxById[id]; - if (idx === undefined) { - throw new Error("Invalid id"); - } - delete idxById[id]; - items.splice(idx, 1); - updateIdxById(idx); - refresh(); - } - - function getLength() { - return rows.length; - } - - function getItem(i) { - var item = rows[i]; - - // if this is a group row, make sure totals are calculated and update the title - if (item && item.__group && item.totals && !item.totals.initialized) { - var gi = groupingInfos[item.level]; - if (!gi.displayTotalsRow) { - calculateTotals(item.totals); - item.title = gi.formatter ? gi.formatter(item) : item.value; - } - } - // if this is a totals row, make sure it's calculated - else if (item && item.__groupTotals && !item.initialized) { - calculateTotals(item); - } - - return item; - } - - function getItemMetadata(i) { - var item = rows[i]; - if (item === undefined) { - return null; - } - - // overrides for grouping rows - if (item.__group) { - return options.groupItemMetadataProvider.getGroupRowMetadata(item); - } - - // overrides for totals rows - if (item.__groupTotals) { - return options.groupItemMetadataProvider.getTotalsRowMetadata(item); - } - - return null; - } - - function expandCollapseAllGroups(level, collapse) { - if (level == null) { - for (var i = 0; i < groupingInfos.length; i++) { - toggledGroupsByLevel[i] = {}; - groupingInfos[i].collapsed = collapse; - } - } else { - toggledGroupsByLevel[level] = {}; - groupingInfos[level].collapsed = collapse; - } - refresh(); - } - - /** - * @param level {Number} Optional level to collapse. If not specified, applies to all levels. - */ - function collapseAllGroups(level) { - expandCollapseAllGroups(level, true); - } - - /** - * @param level {Number} Optional level to expand. If not specified, applies to all levels. - */ - function expandAllGroups(level) { - expandCollapseAllGroups(level, false); - } - - function expandCollapseGroup(level, groupingKey, collapse) { - toggledGroupsByLevel[level][groupingKey] = groupingInfos[level].collapsed ^ collapse; - refresh(); - } - - /** - * @param varArgs Either a Slick.Group's "groupingKey" property, or a - * variable argument list of grouping values denoting a unique path to the row. For - * example, calling collapseGroup('high', '10%') will collapse the '10%' subgroup of - * the 'high' group. - */ - function collapseGroup(varArgs) { - var args = Array.prototype.slice.call(arguments); - var arg0 = args[0]; - if (args.length == 1 && arg0.indexOf(groupingDelimiter) != -1) { - expandCollapseGroup(arg0.split(groupingDelimiter).length - 1, arg0, true); - } else { - expandCollapseGroup(args.length - 1, args.join(groupingDelimiter), true); - } - } - - /** - * @param varArgs Either a Slick.Group's "groupingKey" property, or a - * variable argument list of grouping values denoting a unique path to the row. For - * example, calling expandGroup('high', '10%') will expand the '10%' subgroup of - * the 'high' group. - */ - function expandGroup(varArgs) { - var args = Array.prototype.slice.call(arguments); - var arg0 = args[0]; - if (args.length == 1 && arg0.indexOf(groupingDelimiter) != -1) { - expandCollapseGroup(arg0.split(groupingDelimiter).length - 1, arg0, false); - } else { - expandCollapseGroup(args.length - 1, args.join(groupingDelimiter), false); - } - } - - function getGroups() { - return groups; - } - - function extractGroups(rows, parentGroup) { - var group; - var val; - var groups = []; - var groupsByVal = {}; - var r; - var level = parentGroup ? parentGroup.level + 1 : 0; - var gi = groupingInfos[level]; - - for (var i = 0, l = gi.predefinedValues.length; i < l; i++) { - val = gi.predefinedValues[i]; - group = groupsByVal[val]; - if (!group) { - group = new Slick.Group(); - group.value = val; - group.level = level; - group.groupingKey = (parentGroup ? parentGroup.groupingKey + groupingDelimiter : '') + val; - groups[groups.length] = group; - groupsByVal[val] = group; - } - } - - for (var i = 0, l = rows.length; i < l; i++) { - r = rows[i]; - val = gi.getterIsAFn ? gi.getter(r) : r[gi.getter]; - group = groupsByVal[val]; - if (!group) { - group = new Slick.Group(); - group.value = val; - group.level = level; - group.groupingKey = (parentGroup ? parentGroup.groupingKey + groupingDelimiter : '') + val; - groups[groups.length] = group; - groupsByVal[val] = group; - } - - group.rows[group.count++] = r; - } - - if (level < groupingInfos.length - 1) { - for (var i = 0; i < groups.length; i++) { - group = groups[i]; - group.groups = extractGroups(group.rows, group); - } - } - - groups.sort(groupingInfos[level].comparer); - - return groups; - } - - function calculateTotals(totals) { - var group = totals.group; - var gi = groupingInfos[group.level]; - var isLeafLevel = (group.level == groupingInfos.length); - var agg, idx = gi.aggregators.length; - - if (!isLeafLevel && gi.aggregateChildGroups) { - // make sure all the subgroups are calculated - var i = group.groups.length; - while (i--) { - if (!group.groups[i].totals.initialized) { - calculateTotals(group.groups[i].totals); - } - } - } - - while (idx--) { - agg = gi.aggregators[idx]; - agg.init(); - if (!isLeafLevel && gi.aggregateChildGroups) { - gi.compiledAccumulators[idx].call(agg, group.groups); - } else { - gi.compiledAccumulators[idx].call(agg, group.rows); - } - agg.storeResult(totals); - } - totals.initialized = true; - } - - function addGroupTotals(group) { - var gi = groupingInfos[group.level]; - var totals = new Slick.GroupTotals(); - totals.group = group; - group.totals = totals; - if (!gi.lazyTotalsCalculation) { - calculateTotals(totals); - } - } - - function addTotals(groups, level) { - level = level || 0; - var gi = groupingInfos[level]; - var groupCollapsed = gi.collapsed; - var toggledGroups = toggledGroupsByLevel[level]; - var idx = groups.length, g; - while (idx--) { - g = groups[idx]; - - if (g.collapsed && !gi.aggregateCollapsed) { - continue; - } - - // Do a depth-first aggregation so that parent group aggregators can access subgroup totals. - if (g.groups) { - addTotals(g.groups, level + 1); - } - - if (gi.aggregators.length && ( - gi.aggregateEmpty || g.rows.length || (g.groups && g.groups.length))) { - addGroupTotals(g); - } - - g.collapsed = groupCollapsed ^ toggledGroups[g.groupingKey]; - g.title = gi.formatter ? gi.formatter(g) : g.value; - } - } - - function flattenGroupedRows(groups, level) { - level = level || 0; - var gi = groupingInfos[level]; - var groupedRows = [], rows, gl = 0, g; - for (var i = 0, l = groups.length; i < l; i++) { - g = groups[i]; - groupedRows[gl++] = g; - - if (!g.collapsed) { - rows = g.groups ? flattenGroupedRows(g.groups, level + 1) : g.rows; - for (var j = 0, jj = rows.length; j < jj; j++) { - groupedRows[gl++] = rows[j]; - } - } - - if (g.totals && gi.displayTotalsRow && (!g.collapsed || gi.aggregateCollapsed)) { - groupedRows[gl++] = g.totals; - } - } - return groupedRows; - } - - function getFunctionInfo(fn) { - var fnRegex = /^function[^(]*\(([^)]*)\)\s*{([\s\S]*)}$/; - var matches = fn.toString().match(fnRegex); - return { - params: matches[1].split(","), - body: matches[2] - }; - } - - function compileAccumulatorLoop(aggregator) { - var accumulatorInfo = getFunctionInfo(aggregator.accumulate); - var fn = new Function( - "_items", - "for (var " + accumulatorInfo.params[0] + ", _i=0, _il=_items.length; _i<_il; _i++) {" + - accumulatorInfo.params[0] + " = _items[_i]; " + - accumulatorInfo.body + - "}" - ); - fn.displayName = fn.name = "compiledAccumulatorLoop"; - return fn; - } - - function compileFilter() { - var filterInfo = getFunctionInfo(filter); - - var filterPath1 = "{ continue _coreloop; }$1"; - var filterPath2 = "{ _retval[_idx++] = $item$; continue _coreloop; }$1"; - // make some allowances for minification - there's only so far we can go with RegEx - var filterBody = filterInfo.body - .replace(/return false\s*([;}]|\}|$)/gi, filterPath1) - .replace(/return!1([;}]|\}|$)/gi, filterPath1) - .replace(/return true\s*([;}]|\}|$)/gi, filterPath2) - .replace(/return!0([;}]|\}|$)/gi, filterPath2) - .replace(/return ([^;}]+?)\s*([;}]|$)/gi, - "{ if ($1) { _retval[_idx++] = $item$; }; continue _coreloop; }$2"); - - // This preserves the function template code after JS compression, - // so that replace() commands still work as expected. - var tpl = [ - //"function(_items, _args) { ", - "var _retval = [], _idx = 0; ", - "var $item$, $args$ = _args; ", - "_coreloop: ", - "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", - "$item$ = _items[_i]; ", - "$filter$; ", - "} ", - "return _retval; " - //"}" - ].join(""); - tpl = tpl.replace(/\$filter\$/gi, filterBody); - tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); - tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); - - var fn = new Function("_items,_args", tpl); - fn.displayName = fn.name = "compiledFilter"; - return fn; - } - - function compileFilterWithCaching() { - var filterInfo = getFunctionInfo(filter); - - var filterPath1 = "{ continue _coreloop; }$1"; - var filterPath2 = "{ _cache[_i] = true;_retval[_idx++] = $item$; continue _coreloop; }$1"; - // make some allowances for minification - there's only so far we can go with RegEx - var filterBody = filterInfo.body - .replace(/return false\s*([;}]|\}|$)/gi, filterPath1) - .replace(/return!1([;}]|\}|$)/gi, filterPath1) - .replace(/return true\s*([;}]|\}|$)/gi, filterPath2) - .replace(/return!0([;}]|\}|$)/gi, filterPath2) - .replace(/return ([^;}]+?)\s*([;}]|$)/gi, - "{ if ((_cache[_i] = $1)) { _retval[_idx++] = $item$; }; continue _coreloop; }$2"); - - // This preserves the function template code after JS compression, - // so that replace() commands still work as expected. - var tpl = [ - //"function(_items, _args, _cache) { ", - "var _retval = [], _idx = 0; ", - "var $item$, $args$ = _args; ", - "_coreloop: ", - "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", - "$item$ = _items[_i]; ", - "if (_cache[_i]) { ", - "_retval[_idx++] = $item$; ", - "continue _coreloop; ", - "} ", - "$filter$; ", - "} ", - "return _retval; " - //"}" - ].join(""); - tpl = tpl.replace(/\$filter\$/gi, filterBody); - tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); - tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); - - var fn = new Function("_items,_args,_cache", tpl); - fn.displayName = fn.name = "compiledFilterWithCaching"; - return fn; - } - - function uncompiledFilter(items, args) { - var retval = [], idx = 0; - - for (var i = 0, ii = items.length; i < ii; i++) { - if (filter(items[i], args)) { - retval[idx++] = items[i]; - } - } - - return retval; - } - - function uncompiledFilterWithCaching(items, args, cache) { - var retval = [], idx = 0, item; - - for (var i = 0, ii = items.length; i < ii; i++) { - item = items[i]; - if (cache[i]) { - retval[idx++] = item; - } else if (filter(item, args)) { - retval[idx++] = item; - cache[i] = true; - } - } - - return retval; - } - - function getFilteredAndPagedItems(items) { - if (filter) { - var batchFilter = options.inlineFilters ? compiledFilter : uncompiledFilter; - var batchFilterWithCaching = options.inlineFilters ? compiledFilterWithCaching : uncompiledFilterWithCaching; - - if (refreshHints.isFilterNarrowing) { - filteredItems = batchFilter(filteredItems, filterArgs); - } else if (refreshHints.isFilterExpanding) { - filteredItems = batchFilterWithCaching(items, filterArgs, filterCache); - } else if (!refreshHints.isFilterUnchanged) { - filteredItems = batchFilter(items, filterArgs); - } - } else { - // special case: if not filtering and not paging, the resulting - // rows collection needs to be a copy so that changes due to sort - // can be caught - filteredItems = pagesize ? items : items.concat(); - } - - // get the current page - var paged; - if (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}; - } - - function getRowDiffs(rows, newRows) { - var item, r, eitherIsNonData, diff = []; - var from = 0, to = newRows.length; - - if (refreshHints && refreshHints.ignoreDiffsBefore) { - from = Math.max(0, - Math.min(newRows.length, refreshHints.ignoreDiffsBefore)); - } - - if (refreshHints && refreshHints.ignoreDiffsAfter) { - to = Math.min(newRows.length, - Math.max(0, refreshHints.ignoreDiffsAfter)); - } - - for (var i = from, rl = rows.length; i < to; i++) { - if (i >= rl) { - diff[diff.length] = i; - } else { - item = newRows[i]; - r = rows[i]; - - if ((groupingInfos.length && (eitherIsNonData = (item.__nonDataRow) || (r.__nonDataRow)) && - item.__group !== r.__group || - item.__group && !item.equals(r)) - || (eitherIsNonData && - // no good way to compare totals since they are arbitrary DTOs - // deep object comparison is pretty expensive - // always considering them 'dirty' seems easier for the time being - (item.__groupTotals || r.__groupTotals)) - || item[idProperty] != r[idProperty] - || (updated && updated[item[idProperty]]) - ) { - diff[diff.length] = i; - } - } - } - return diff; - } - - function recalc(_items) { - rowsById = null; - - if (refreshHints.isFilterNarrowing != prevRefreshHints.isFilterNarrowing || - refreshHints.isFilterExpanding != prevRefreshHints.isFilterExpanding) { - filterCache = []; - } - - var filteredItems = getFilteredAndPagedItems(_items); - totalRows = filteredItems.totalRows; - var newRows = filteredItems.rows; - - groups = []; - if (groupingInfos.length) { - groups = extractGroups(newRows); - if (groups.length) { - addTotals(groups); - newRows = flattenGroupedRows(groups); - } - } - - var diff = getRowDiffs(rows, newRows); - - rows = newRows; - - return diff; - } - - function refresh() { - if (suspend) { - return; - } - - var countBefore = rows.length; - var totalRowsBefore = totalRows; - - var diff = recalc(items, filter); // pass as direct refs to avoid closure perf hit - - // if the current page is no longer valid, go to last page and recalc - // we suffer a performance penalty here, but the main loop (recalc) remains highly optimized - if (pagesize && totalRows < pagenum * pagesize) { - pagenum = Math.max(0, Math.ceil(totalRows / pagesize) - 1); - diff = recalc(items, filter); - } - - updated = null; - prevRefreshHints = refreshHints; - refreshHints = {}; - - if (totalRowsBefore !== totalRows) { - onPagingInfoChanged.notify(getPagingInfo(), null, self); - } - if (countBefore !== rows.length) { - onRowCountChanged.notify({previous: countBefore, current: rows.length, dataView: self}, null, self); - } - if (diff.length > 0) { - onRowsChanged.notify({rows: diff, dataView: self}, null, self); - } - } - - /*** - * Wires the grid and the DataView together to keep row selection tied to item ids. - * This is useful since, without it, the grid only knows about rows, so if the items - * move around, the same rows stay selected instead of the selection moving along - * with the items. - * - * NOTE: This doesn't work with cell selection model. - * - * @param grid {Slick.Grid} The grid to sync selection with. - * @param preserveHidden {Boolean} Whether to keep selected items that go out of the - * view due to them getting filtered out. - * @param preserveHiddenOnSelectionChange {Boolean} Whether to keep selected items - * that are currently out of the view (see preserveHidden) as selected when selection - * changes. - * @return {Slick.Event} An event that notifies when an internal list of selected row ids - * changes. This is useful since, in combination with the above two options, it allows - * access to the full list selected row ids, and not just the ones visible to the grid. - * @method syncGridSelection - */ - function syncGridSelection(grid, preserveHidden, preserveHiddenOnSelectionChange) { - var self = this; - var inHandler; - var selectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); - var onSelectedRowIdsChanged = new Slick.Event(); - - function setSelectedRowIds(rowIds) { - if (selectedRowIds.join(",") == rowIds.join(",")) { - return; - } - - selectedRowIds = rowIds; - - onSelectedRowIdsChanged.notify({ - "grid": grid, - "ids": selectedRowIds, - "dataView": self - }, new Slick.EventData(), self); - } - - function update() { - if (selectedRowIds.length > 0) { - inHandler = true; - var selectedRows = self.mapIdsToRows(selectedRowIds); - if (!preserveHidden) { - setSelectedRowIds(self.mapRowsToIds(selectedRows)); - } - grid.setSelectedRows(selectedRows); - inHandler = false; - } - } - - grid.onSelectedRowsChanged.subscribe(function(e, args) { - if (inHandler) { return; } - var newSelectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); - if (!preserveHiddenOnSelectionChange || !grid.getOptions().multiSelect) { - setSelectedRowIds(newSelectedRowIds); - } else { - // keep the ones that are hidden - var existing = $.grep(selectedRowIds, function(id) { return self.getRowById(id) === undefined; }); - // add the newly selected ones - setSelectedRowIds(existing.concat(newSelectedRowIds)); - } - }); - - this.onRowsChanged.subscribe(update); - - this.onRowCountChanged.subscribe(update); - - return onSelectedRowIdsChanged; - } - - function syncGridCellCssStyles(grid, key) { - var hashById; - var inHandler; - - // since this method can be called after the cell styles have been set, - // get the existing ones right away - storeCellCssStyles(grid.getCellCssStyles(key)); - - function storeCellCssStyles(hash) { - hashById = {}; - for (var row in hash) { - var id = rows[row][idProperty]; - hashById[id] = hash[row]; - } - } - - function update() { - if (hashById) { - inHandler = true; - ensureRowsByIdCache(); - var newHash = {}; - for (var id in hashById) { - var row = rowsById[id]; - if (row != undefined) { - newHash[row] = hashById[id]; - } - } - grid.setCellCssStyles(key, newHash); - inHandler = false; - } - } - - grid.onCellCssStylesChanged.subscribe(function(e, args) { - if (inHandler) { return; } - if (key != args.key) { return; } - if (args.hash) { - storeCellCssStyles(args.hash); - } else { - grid.onCellCssStylesChanged.unsubscribe(styleChanged); - self.onRowsChanged.unsubscribe(update); - self.onRowCountChanged.unsubscribe(update); - } - }); - - this.onRowsChanged.subscribe(update); - - this.onRowCountChanged.subscribe(update); - } - - $.extend(this, { - // methods - "beginUpdate": beginUpdate, - "endUpdate": endUpdate, - "setPagingOptions": setPagingOptions, - "getPagingInfo": getPagingInfo, - "getItems": getItems, - "setItems": setItems, - "setFilter": setFilter, - "getFilter": getFilter, - "getFilteredItems": getFilteredItems, - "sort": sort, - "fastSort": fastSort, - "reSort": reSort, - "setGrouping": setGrouping, - "getGrouping": getGrouping, - "groupBy": groupBy, - "setAggregators": setAggregators, - "collapseAllGroups": collapseAllGroups, - "expandAllGroups": expandAllGroups, - "collapseGroup": collapseGroup, - "expandGroup": expandGroup, - "getGroups": getGroups, - "getIdxById": getIdxById, - "getRowById": getRowById, - "getItemById": getItemById, - "getItemByIdx": getItemByIdx, - "mapRowsToIds": mapRowsToIds, - "mapIdsToRows": mapIdsToRows, - "setRefreshHints": setRefreshHints, - "setFilterArgs": setFilterArgs, - "refresh": refresh, - "updateItem": updateItem, - "insertItem": insertItem, - "addItem": addItem, - "deleteItem": deleteItem, - "syncGridSelection": syncGridSelection, - "syncGridCellCssStyles": syncGridCellCssStyles, - - // data provider methods - "getLength": getLength, - "getItem": getItem, - "getItemMetadata": getItemMetadata, - - // events - "onRowCountChanged": onRowCountChanged, - "onRowsChanged": onRowsChanged, - "onPagingInfoChanged": onPagingInfoChanged - }); - } - - function AvgAggregator(field) { - this.field_ = field; - - this.init = function () { - this.count_ = 0; - this.nonNullCount_ = 0; - this.sum_ = 0; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - this.count_++; - if (val != null && val !== "" && !isNaN(val)) { - this.nonNullCount_++; - this.sum_ += parseFloat(val); - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.avg) { - groupTotals.avg = {}; - } - if (this.nonNullCount_ != 0) { - groupTotals.avg[this.field_] = this.sum_ / this.nonNullCount_; - } - }; - } - - function MinAggregator(field) { - this.field_ = field; - - this.init = function () { - this.min_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val !== "" && !isNaN(val)) { - if (this.min_ == null || val < this.min_) { - this.min_ = val; - } - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.min) { - groupTotals.min = {}; - } - groupTotals.min[this.field_] = this.min_; - } - } - - function MaxAggregator(field) { - this.field_ = field; - - this.init = function () { - this.max_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val !== "" && !isNaN(val)) { - if (this.max_ == null || val > this.max_) { - this.max_ = val; - } - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.max) { - groupTotals.max = {}; - } - groupTotals.max[this.field_] = this.max_; - } - } - - function SumAggregator(field) { - this.field_ = field; - - this.init = function () { - this.sum_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val !== "" && !isNaN(val)) { - this.sum_ += parseFloat(val); - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.sum) { - groupTotals.sum = {}; - } - groupTotals.sum[this.field_] = this.sum_; - } - } - - // TODO: add more built-in aggregators - // TODO: merge common aggregators in one to prevent needles iterating - -})(jQuery); diff --git a/web/pgadmin/static/vendor/slickgrid/slick.editors.js b/web/pgadmin/static/vendor/slickgrid/slick.editors.js deleted file mode 100644 index 33b4e266..00000000 --- a/web/pgadmin/static/vendor/slickgrid/slick.editors.js +++ /dev/null @@ -1,634 +0,0 @@ -/*** - * Contains basic SlickGrid editors. - * @module Editors - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Editors": { - "Text": TextEditor, - "Integer": IntegerEditor, - "Float": FloatEditor, - "Date": DateEditor, - "YesNoSelect": YesNoSelectEditor, - "Checkbox": CheckboxEditor, - "PercentComplete": PercentCompleteEditor, - "LongText": LongTextEditor - } - } - }); - - function TextEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $("") - .appendTo(args.container) - .on("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }) - .focus() - .select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.getValue = function () { - return $input.val(); - }; - - this.setValue = function (val) { - $input.val(val); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field] || ""; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function IntegerEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - - $input.on("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }); - - $input.appendTo(args.container); - $input.focus().select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (isNaN($input.val())) { - return { - valid: false, - msg: "Please enter a valid integer" - }; - } - - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function FloatEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - - $input.on("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }); - - $input.appendTo(args.container); - $input.focus().select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $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); - } - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - - var decPlaces = getDecimalPlaces(); - if (decPlaces !== null - && (defaultValue || defaultValue===0) - && defaultValue.toFixed) { - defaultValue = defaultValue.toFixed(decPlaces); - } - - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - var rtn = parseFloat($input.val()) || 0; - - var decPlaces = getDecimalPlaces(); - if (decPlaces !== null - && (rtn || rtn===0) - && rtn.toFixed) { - rtn = parseFloat(rtn.toFixed(decPlaces)); - } - - return rtn; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (isNaN($input.val())) { - return { - valid: false, - msg: "Please enter a valid number" - }; - } - - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - FloatEditor.DefaultDecimalPlaces = null; - - function DateEditor(args) { - var $input; - var defaultValue; - var scope = this; - var calendarOpen = false; - - this.init = function () { - $input = $(""); - $input.appendTo(args.container); - $input.focus().select(); - $input.datepicker({ - showOn: "button", - buttonImageOnly: true, - beforeShow: function () { - calendarOpen = true - }, - onClose: function () { - calendarOpen = false - } - }); - $input.width($input.width() - 18); - }; - - this.destroy = function () { - $.datepicker.dpDiv.stop(true, true); - $input.datepicker("hide"); - $input.datepicker("destroy"); - $input.remove(); - }; - - this.show = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).show(); - } - }; - - this.hide = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).hide(); - } - }; - - this.position = function (position) { - if (!calendarOpen) { - return; - } - $.datepicker.dpDiv - .css("top", position.top + 30) - .css("left", position.left); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function YesNoSelectEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - $select.val((defaultValue = item[args.column.field]) ? "yes" : "no"); - $select.select(); - }; - - this.serializeValue = function () { - return ($select.val() == "yes"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function CheckboxEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - defaultValue = !!item[args.column.field]; - if (defaultValue) { - $select.prop('checked', true); - } else { - $select.prop('checked', false); - } - }; - - this.preClick = function () { - $select.prop('checked', !$select.prop('checked')); - }; - - this.serializeValue = function () { - return $select.prop('checked'); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (this.serializeValue() !== defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function PercentCompleteEditor(args) { - var $input, $picker; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - $input.width($(args.container).innerWidth() - 25); - $input.appendTo(args.container); - - $picker = $(""); - - $picker.find(".editor-percentcomplete-buttons").append("
"); - - $input.focus().select(); - - $picker.find(".editor-percentcomplete-slider").slider({ - orientation: "vertical", - range: "min", - value: defaultValue, - slide: function (event, ui) { - $input.val(ui.value) - } - }); - - $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")); - }) - }; - - this.destroy = function () { - $input.remove(); - $picker.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - $input.val(defaultValue = item[args.column.field]); - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ((parseInt($input.val(), 10) || 0) != defaultValue); - }; - - this.validate = function () { - if (isNaN(parseInt($input.val(), 10))) { - return { - valid: false, - msg: "Please enter a valid positive number" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - /* - * An example of a "detached" editor. - * The UI is added onto document BODY and .position(), .show() and .hide() are implemented. - * KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter. - */ - function LongTextEditor(args) { - var $input, $wrapper; - var defaultValue; - var scope = this; - - this.init = function () { - var $container = $("body"); - - $wrapper = $("") - .appendTo($container); - - $input = $("