Skip to content

Commit

Permalink
Merge pull request #1064 from adumesny/develop
Browse files Browse the repository at this point in the history
add `jquery-ui.js` minimal need
  • Loading branch information
Alain Dumesny authored Nov 21, 2019
2 parents 7ab2f3c + 0a51f87 commit e91ce7e
Show file tree
Hide file tree
Showing 22 changed files with 4,073 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/*.js
demo/*
spec/*
src/jquery-ui.js
src/jquery-ui.min.js
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports = function(grunt) {
'dist/gridstack.d.ts': ['src/gridstack.d.ts'],
'dist/gridstack.jQueryUI.js': ['src/gridstack.jQueryUI.js'],
'dist/gridstack.poly.js': ['src/gridstack.poly.js'],
'dist/jquery-ui.js': ['src/jquery-ui.js'],
'dist/jquery-ui.min.js': ['src/jquery-ui.min.js'],
}
}
},
Expand All @@ -54,7 +56,7 @@ module.exports = function(grunt) {
'dist/gridstack.min.js': ['src/gridstack.js'],
'dist/gridstack.jQueryUI.min.js': ['src/gridstack.jQueryUI.js'],
'dist/gridstack.poly.min.js': ['src/gridstack.poly.js'],
'dist/gridstack.all.js': ['src/gridstack.poly.js', 'src/gridstack.js', 'src/gridstack.jQueryUI.js']
'dist/gridstack.all.js': ['src/gridstack.poly.js', 'src/gridstack.js', 'src/jquery-ui.js', 'src/gridstack.jQueryUI.js']
}
}
},
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,32 @@ Usage
## Requirements

* [jQuery](http://jquery.com) (>= 3.1.0)
* `Array.prototype.find`, and `Number.isNaN()` for IE and older browsers. We supply a separate `gridstack.poly.js` for that
* `Array.prototype.find`, and `Number.isNaN()` for IE and older browsers.
* Note: as of v0.5.4 We supply a separate `gridstack.poly.js` for that
(part of `gridstack.all.js`) or you can look at other pollyfills
([core.js](https://github.com/zloirock/core-js#ecmascript-6-array) and [mozilla.org](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)).

#### Using gridstack.js with jQuery UI

* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Draggable, Droppable, Resizable (Widget, Mouse, core).
* Note: as of v0.5.4 we include this subset as `jquery-ui.js` (and min.js) which is part of `gridstack.all.js`. If you wish to bring your own lib, include the individual gridstack parts instead of all.js
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support

## Install

* Using CDN (minimized):

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack.min.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack.all.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack.min.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack.all.js"></script>
```

* Using CDN (debug):

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack.jQueryUI.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack.jQueryUI.js"></script>
```

* or local:
Expand Down Expand Up @@ -188,7 +190,7 @@ $('.grid-stack').gridstack( {column: N} );

2) and change your HTML accordingly if **N < 12** (else custom CSS section next). Without this, things will not render/work correctly.
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.5.3/dist/gridstack-extra.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@latest/dist/gridstack-extra.css"/>

<div class="grid-stack grid-stack-N">...</div>
```
Expand Down
2 changes: 1 addition & 1 deletion demo/anijs.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/float.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/knockout.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/knockout2.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/responsive.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/right-to-left(rtl).html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/serialization.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/two.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../src/jquery-ui.min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

Expand Down
3 changes: 2 additions & 1 deletion doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Change log

## v0.5.3-dev (upcoming changes)

- add `gridstack.poly.js` for IE and older browsers, removed core-js from samples, and all IE8 mentions
- add `gridstack.poly.js` for IE and older browsers, removed `core-js` lib from samples (<1k vs 85k), and all IE8 mentions ([#1061](https://github.com/gridstack/gridstack.js/pull/1061)).
- add `jquery-ui.js` (and min.js) as minimal subset we need (55k vs 248k), which is now part of `gridstack.all.js` - so just 1 include needed now.

## v0.5.3 (2019-11-20)

Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/components-jqueryui/jquery-ui.min.js',
'node_modules/core-js/client/shim.min.js',
'src/gridstack.js',
'src/jquery-ui.min.js',
'src/gridstack.jQueryUI.js',
'spec/*-spec.js',
// 'spec/e2e/*-spec.js' issues with ReferenceError: `browser` & `element` is not defined
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
},
"homepage": "http://gridstack.github.io/gridstack.js/",
"dependencies": {
"jquery": "^3.1.0",
"jquery-ui": "^1.12.0"
"jquery": "^3.1.0"
},
"devDependencies": {
"components-jqueryui": "1.12.1",
Expand Down
2 changes: 1 addition & 1 deletion spec/e2e/html/1017-items-no-x-y-for-autoPosition.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<link rel="stylesheet" href="../../../dist/gridstack.css" />

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../../../src/jquery-ui.min.js"></script>
<script src="../../../src/gridstack.js"></script>
<script src="../../../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion spec/e2e/html/810-many-columns.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="stylesheet" href="810-many-columns.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../../../src/jquery-ui.min.js"></script>
<script src="../../../src/gridstack.js"></script>
<script src="../../../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion spec/e2e/html/column.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="stylesheet" href="../../../dist/gridstack-extra.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../../../src/jquery-ui.min.js"></script>
<script src="../../../src/gridstack.js"></script>
<script src="../../../src/gridstack.jQueryUI.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion spec/e2e/html/gridstack-with-height.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<link rel="stylesheet" href="../../../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="../../../src/jquery-ui.min.js"></script>
<script src="../../../dist/gridstack.js"></script>
<script src="../../../dist/gridstack.jQueryUI.js"></script>

Expand Down
Loading

0 comments on commit e91ce7e

Please sign in to comment.