Skip to content

Commit

Permalink
Node.js integration update
Browse files Browse the repository at this point in the history
  • Loading branch information
misantron committed Jul 5, 2016
1 parent 3197c17 commit 55860f7
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 25 deletions.
6 changes: 5 additions & 1 deletion .gitignore
@@ -1,2 +1,6 @@
.idea/
bower_components/
/nbproject/
bower_components/
node_modules/

composer.lock
8 changes: 8 additions & 0 deletions .npmignore
@@ -0,0 +1,8 @@
.idea/
/nbproject/
bower_components/
node_modules/

bower.json
composer.json
component.json
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -8,9 +8,9 @@ jQuery DataTables plugin and Bootstrap 3 integration.

## Installing

**NPM** `npm i datatables-bootstrap3-plugin`
**NPM** `npm install --save datatables-bootstrap3-plugin`

**Bower** `bower install datatables-bootstrap3-plugin`
**Bower** `bower install --save datatables-bootstrap3-plugin`

Include library and style files directly to your HTML page:

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

## External dependencies:

* Bootstrap 3.*
* Bootstrap 3.3.*
* Font Awesome 4.*
* jQuery DataTables 1.10.*
* jQuery 1.*

## Fork changes

Expand Down
16 changes: 8 additions & 8 deletions bower.json
@@ -1,17 +1,15 @@
{
"name": "datatables-bootstrap3-plugin",
"version": "0.4.0",
"main": [
"media/css/datatables-bootstrap3.css",
"media/css/datatables-bootstrap3.min.css",
"media/css/datatables-bootstrap3.less",
"media/js/datatables-bootstrap3.js",
"media/js/datatables-bootstrap3.min.js"
"media/js/datatables-bootstrap3.js"
],
"dependencies": {
"bootstrap": "~3.3",
"font-awesome": "~4.3",
"datatables": "~1.10"
"bootstrap": "^3.3",
"font-awesome": "^4.3",
"datatables": "^1.10",
"jquery": "^1.11"
},
"description": "jQuery DataTables plugin and Bootstrap 3 integration.",
"license": "MIT",
Expand All @@ -22,9 +20,11 @@
"plugin"
],
"ignore": [
".gitignore",
"/.*",
"example",
"bower_components",
"composer.json",
"package.json",
"README.md"
]
}
14 changes: 14 additions & 0 deletions composer.json
@@ -0,0 +1,14 @@
{
"name": "misantron/datatables-bootstrap3-plugin",
"description": "DataTables jQuery plugin and Bootstrap 3 integration plugin",
"keywords": ["datatables", "bootstrap", "plugin", "javascript"],
"type": "library",
"license": "MIT",
"homepage": "https://github.com/misantron/datatables-bootstrap3-plugin",
"authors": [
{
"name": "Alexandr Ivanov",
"email": "misantron@gmail.com"
}
]
}
8 changes: 4 additions & 4 deletions example/index.html
Expand Up @@ -5,8 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Example Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet">
<link href="css/datatables-bootstrap3.css" rel="stylesheet">
</head>
<body>
Expand Down Expand Up @@ -333,8 +333,8 @@
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="js/datatables-bootstrap3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
Expand Down
1 change: 0 additions & 1 deletion media/css/datatables-bootstrap3.min.css

This file was deleted.

14 changes: 11 additions & 3 deletions media/js/datatables-bootstrap3.js
Expand Up @@ -10,11 +10,19 @@
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
module.exports = factory( require('jquery'), require('datatables') );
module.exports = function ( $dt ) {
if ( $dt === undefined ) {
$dt = require('datatables')();
}
if ( $dt.fn === undefined || $dt.fn.DataTable === undefined ) {
$dt = require('datatables')($dt);
}
return factory( $dt );
}
}
else if ( jQuery ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
factory( jQuery );
}
}(function ($, DataTable) {
"use strict";
Expand Down Expand Up @@ -107,7 +115,7 @@
'aria-controls': settings.sTableId,
'tabindex': settings.iTabIndex,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
settings.sTableId +'_'+ button :
null
} )
.append( $('<a>', {
Expand Down
1 change: 0 additions & 1 deletion media/js/datatables-bootstrap3.min.js

This file was deleted.

11 changes: 7 additions & 4 deletions package.json
@@ -1,8 +1,11 @@
{
"name": "datatables-bootstrap3-plugin",
"description": "jQuery DataTables plugin and Bootstrap 3 integration.",
"author": "misantron <misantron@gmail.com>",
"version": "0.4.0",
"author": {
"name": "Aleksandr Ivanov",
"email": "misantron@gmail.com"
},
"keywords": [
"javascript",
"datatables",
Expand All @@ -19,9 +22,9 @@
},
"license": "MIT",
"dependencies": {
"bootstrap": "~3.3",
"font-awesome": "~4.3",
"datatables": "~1.10",
"bootstrap": "^3.3",
"font-awesome": "^4.3",
"datatables": "^1.10",
"jquery": "~1.11"
},
"engines": {
Expand Down

0 comments on commit 55860f7

Please sign in to comment.