Skip to content

Commit ae8ed60

Browse files
committed
Add support for custom classes.
Fix #24 Add support for npm module and script tag. Update docs.
1 parent 774223c commit ae8ed60

File tree

12 files changed

+22728
-39
lines changed

12 files changed

+22728
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.swp

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ Clone the repository and reference the *jquery.simple.timer.js* file from your h
3535
<script src="jquery.simple.timer.js"></script>
3636
```
3737

38+
### npm
39+
40+
To install from npm, run:
41+
42+
```
43+
npm install jquery-simple-timer --save
44+
```
45+
46+
jQuery is **NOT** installed automatically. We need to install jQuery (`npm install jquery --save`) and then pass it as an argument to the return value of the `require()` statement. Here's an example:
47+
48+
```javascript
49+
// file: client.js
50+
"use strict";
51+
52+
let $ = require("jquery");
53+
require("jquery-simple-timer")($); // passing jQuery as argument
54+
55+
$(function(){
56+
$('.timer').startTimer();
57+
});
58+
```
59+
3860
### Bower
3961

4062
In order to install it using Bower, make sure you have node, npm and bower installed:

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jQuery-Simple-Timer",
3-
"version": "0.0.5",
3+
"version": "1.0.0",
44
"homepage": "http://csouza.me/jQuery-Simple-Timer",
55
"authors": [
66
"Carlos Souza <carloshrsouza@gmail.com>"
@@ -21,5 +21,5 @@
2121
"test",
2222
"tests"
2323
],
24-
"dependencies": { "jquery": "1.11.0" }
24+
"dependencies": { "jquery": "~1.12.4" }
2525
}

0 commit comments

Comments
 (0)