PageSourceSearch

https://marsactu.fr/tool/src/gridstack.jQueryUI.js

js marsactu.fr collected 2026-10-02 06:28:30 UTC 3,728 bytes, 93 lines download raw bytes

1/**
2 * gridstack.js 1.0.0-dev
3 * http://troolee.github.io/gridstack.js/
4 * (c) 2014-2017 Pavel Reznikov, Dylan Weiss
5 * gridstack.js may be freely distributed under the MIT license.
6 * @preserve
7*/
8(function(factory) {
9    if (typeof define === 'function' && define.amd) {
10        define(['jquery', 'gridstack', 'exports', 'jquery-ui/data', 'jquery-ui/disable-selection',
11            'jquery-ui/focusable', 'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels',
12            'jquery-ui/jquery-1-7', 'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur',
13            'jquery-ui/scroll-parent', 'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version',
14            'jquery-ui/widget', 'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable',
15            'jquery-ui/widgets/droppable', 'jquery-ui/widgets/resizable'], factory);
16    } else if (typeof exports !== 'undefined') {
17        try { jQuery = require('jquery'); } catch (e) {}
18        try { gridstack = require('gridstack'); } catch (e) {}
19        factory(jQuery, gridstack.GridStackUI, exports);
20    } else {
21        factory(jQuery, GridStackUI, window);
22    }
23})(function($, GridStackUI, scope) {
24    /**
25    * @class JQueryUIGridStackDragDropPlugin
26    * jQuery UI implementation of drag'n'drop gridstack plugin.
27    */
28    function JQueryUIGridStackDragDropPlugin(grid) {
29        GridStackUI.GridStackDragDropPlugin.call(this, grid);
30    }
31
32    GridStackUI.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);
33
34    JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackUI.GridStackDragDropPlugin.prototype);
35    JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;
36
37    JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) {
38        el = $(el);
39        if (opts === 'disable' || opts === 'enable') {
40            el.resizable(opts);
41        } else if (opts === 'option') {
42            var key = arguments[2];
43            var value = arguments[3];
44            el.resizable(opts, key, value);
45        } else {
46            var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
47                this.grid.opts.resizable.handles;
48            el.resizable($.extend({}, this.grid.opts.resizable, {
49                handles: handles
50            }, {
51                start: opts.start || function() {},
52                stop: opts.stop || function() {},
53                resize: opts.resize || function() {}
54            }));
55        }
56        return this;
57    };
58
59    JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) {
60        el = $(el);
61        if (opts === 'disable' || opts === 'enable') {
62            el.draggable(opts);
63        } else {
64            el.draggable($.extend({}, this.grid.opts.draggable, {
65                containment: this.grid.opts.isNested ? this.grid.container.parent() : null,
66                start: opts.start || function() {},
67                stop: opts.stop || function() {},
68                drag: opts.drag || function() {}
69            }));
70        }
71        return this;
72    };
73
74    JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
75        el = $(el);
76        el.droppable(opts);
77        return this;
78    };
79
80    JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) {
81        el = $(el);
82        return Boolean(el.data('droppable'));
83    };
84
85    JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) {
86        $(el).on(eventName, callback);
87        return this;
88    };
89
90    scope.JQueryUIGridStackDragDropPlugin = JQueryUIGridStackDragDropPlugin;
91
92    return JQueryUIGridStackDragDropPlugin;
93});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.