Skip to content

Commit 55860f7

Browse files
committed
Node.js integration update
1 parent 3197c17 commit 55860f7

File tree

10 files changed

+61
-25
lines changed

10 files changed

+61
-25
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
.idea/
2-
bower_components/
2+
/nbproject/
3+
bower_components/
4+
node_modules/
5+
6+
composer.lock

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea/
2+
/nbproject/
3+
bower_components/
4+
node_modules/
5+
6+
bower.json
7+
composer.json
8+
component.json

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jQuery DataTables plugin and Bootstrap 3 integration.
88

99
## Installing
1010

11-
**NPM** `npm i datatables-bootstrap3-plugin`
11+
**NPM** `npm install --save datatables-bootstrap3-plugin`
1212

13-
**Bower** `bower install datatables-bootstrap3-plugin`
13+
**Bower** `bower install --save datatables-bootstrap3-plugin`
1414

1515
Include library and style files directly to your HTML page:
1616

@@ -21,9 +21,10 @@ Include library and style files directly to your HTML page:
2121

2222
## External dependencies:
2323

24-
* Bootstrap 3.*
24+
* Bootstrap 3.3.*
2525
* Font Awesome 4.*
2626
* jQuery DataTables 1.10.*
27+
* jQuery 1.*
2728

2829
## Fork changes
2930

bower.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"name": "datatables-bootstrap3-plugin",
3-
"version": "0.4.0",
43
"main": [
54
"media/css/datatables-bootstrap3.css",
6-
"media/css/datatables-bootstrap3.min.css",
75
"media/css/datatables-bootstrap3.less",
8-
"media/js/datatables-bootstrap3.js",
9-
"media/js/datatables-bootstrap3.min.js"
6+
"media/js/datatables-bootstrap3.js"
107
],
118
"dependencies": {
12-
"bootstrap": "~3.3",
13-
"font-awesome": "~4.3",
14-
"datatables": "~1.10"
9+
"bootstrap": "^3.3",
10+
"font-awesome": "^4.3",
11+
"datatables": "^1.10",
12+
"jquery": "^1.11"
1513
},
1614
"description": "jQuery DataTables plugin and Bootstrap 3 integration.",
1715
"license": "MIT",
@@ -22,9 +20,11 @@
2220
"plugin"
2321
],
2422
"ignore": [
25-
".gitignore",
23+
"/.*",
2624
"example",
2725
"bower_components",
26+
"composer.json",
27+
"package.json",
2828
"README.md"
2929
]
3030
}

composer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "misantron/datatables-bootstrap3-plugin",
3+
"description": "DataTables jQuery plugin and Bootstrap 3 integration plugin",
4+
"keywords": ["datatables", "bootstrap", "plugin", "javascript"],
5+
"type": "library",
6+
"license": "MIT",
7+
"homepage": "https://github.com/misantron/datatables-bootstrap3-plugin",
8+
"authors": [
9+
{
10+
"name": "Alexandr Ivanov",
11+
"email": "misantron@gmail.com"
12+
}
13+
]
14+
}

example/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>Example Template</title>
8-
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
9-
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
8+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
9+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet">
1010
<link href="css/datatables-bootstrap3.css" rel="stylesheet">
1111
</head>
1212
<body>
@@ -333,8 +333,8 @@
333333
</div>
334334

335335
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
336-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
337-
<script src="https://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
336+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
337+
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
338338
<script src="js/datatables-bootstrap3.js"></script>
339339
<script type="text/javascript">
340340
$(document).ready(function(){

media/css/datatables-bootstrap3.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

media/js/datatables-bootstrap3.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@
1010
}
1111
else if ( typeof exports === 'object' ) {
1212
// Node/CommonJS
13-
module.exports = factory( require('jquery'), require('datatables') );
13+
module.exports = function ( $dt ) {
14+
if ( $dt === undefined ) {
15+
$dt = require('datatables')();
16+
}
17+
if ( $dt.fn === undefined || $dt.fn.DataTable === undefined ) {
18+
$dt = require('datatables')($dt);
19+
}
20+
return factory( $dt );
21+
}
1422
}
1523
else if ( jQuery ) {
1624
// Otherwise simply initialise as normal, stopping multiple evaluation
17-
factory( jQuery, jQuery.fn.dataTable );
25+
factory( jQuery );
1826
}
1927
}(function ($, DataTable) {
2028
"use strict";
@@ -107,7 +115,7 @@
107115
'aria-controls': settings.sTableId,
108116
'tabindex': settings.iTabIndex,
109117
'id': idx === 0 && typeof button === 'string' ?
110-
settings.sTableId +'_'+ button :
118+
settings.sTableId +'_'+ button :
111119
null
112120
} )
113121
.append( $('<a>', {

media/js/datatables-bootstrap3.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "datatables-bootstrap3-plugin",
33
"description": "jQuery DataTables plugin and Bootstrap 3 integration.",
4-
"author": "misantron <misantron@gmail.com>",
54
"version": "0.4.0",
5+
"author": {
6+
"name": "Aleksandr Ivanov",
7+
"email": "misantron@gmail.com"
8+
},
69
"keywords": [
710
"javascript",
811
"datatables",
@@ -19,9 +22,9 @@
1922
},
2023
"license": "MIT",
2124
"dependencies": {
22-
"bootstrap": "~3.3",
23-
"font-awesome": "~4.3",
24-
"datatables": "~1.10",
25+
"bootstrap": "^3.3",
26+
"font-awesome": "^4.3",
27+
"datatables": "^1.10",
2528
"jquery": "~1.11"
2629
},
2730
"engines": {

0 commit comments

Comments
 (0)