Skip to content

Commit ba060ea

Browse files
committed
Fix issue #79 & jscs
1 parent e47143d commit ba060ea

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

Gruntfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ module.exports = function(grunt) {
44
pkg: grunt.file.readJSON('package.json'),
55

66
jscs: {
7-
src: ['Gruntfile.js', 'src/*.js', 'test/*.js']
7+
src: ['Gruntfile.js', 'src/*.js', 'test/utils-test.js', 'test/basicTimerSpec', 'test/timedFuncSpec.js']
88
},
99

1010
jshint: {
11-
all: ['Gruntfile.js', 'src/*.js', 'test/*.js']
11+
all: ['Gruntfile.js', 'src/*.js', 'test/utils-test.js', 'test/basicTimerSpec', 'test/timedFuncSpec.js']
1212
},
1313

1414
concat: {
1515
options: {
1616
banner: [
1717
'/*! <%= pkg.name %> <%= pkg.version %> <%=grunt.template.today("yyyy-mm-dd")%>*/\n',
18-
'(function() {\n'
18+
'(function($) {\n'
1919
].join(''),
20-
footer: '} ());'
20+
footer: '} (jQuery));'
2121
},
2222
dist: {
2323
src: [

dist/timer.jquery.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/*! timer.jquery 0.7.0 2017-04-15*/
2-
(function() {
1+
/*! timer.jquery 0.7.1 2017-09-27*/
2+
(function($) {
33
var Constants = {
44
PLUGIN_NAME: 'timer',
55
TIMER_RUNNING: 'running',
@@ -421,4 +421,4 @@ $.fn.timer = function(options) {
421421
}
422422
});
423423
};
424-
} ());
424+
} (jQuery));

dist/timer.jquery.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "timer.jquery",
33
"description": "Start/Stop/Resume/Remove a pretty timer inside any HTML element.",
44
"author": "Walmik Deshpande",
5-
"version": "0.7.0",
5+
"version": "0.7.1",
66
"repository": {
77
"type": "git",
88
"url": "git://github.com/walmik/timer.jquery.git"

test/timedFuncSpec.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
describe('Timed functions', function () {
1+
describe('Timed functions', function() {
22
beforeEach(function() {
33
setFixtures('<div id="timer"></div>');
44
});
55

66
// Start a timer in a DIV
77
describe('Start a timer in a DIV', function() {
88
var timeElapsed = 0;
9-
beforeEach(function (done) {
10-
$('#timer').timer();
9+
beforeEach(function(done) {
10+
$('#timer').timer();
1111
setTimeout(done, 1000);
1212
});
1313

14-
it('Should be true if the async call has completed', function () {
14+
it('Should be true if the async call has completed', function() {
1515
expect($('#timer').data('seconds')).toEqual(1);
1616
});
1717
});
1818

1919
// Start timer in an INPUT element
2020
describe('Start a timer in a INPUT element', function() {
21-
beforeEach(function (done) {
21+
beforeEach(function(done) {
2222
setFixtures('<input id="inputTimer" type="text"/>');
23-
$('#inputTimer').timer();
23+
$('#inputTimer').timer();
2424
setTimeout(done, 1000);
2525
});
2626

27-
it('Should be true if the async call has completed', function () {
27+
it('Should be true if the async call has completed', function() {
2828
expect($('#inputTimer').data('seconds')).toEqual(1);
2929
});
3030
});
3131

3232
// Pause a timer
3333
describe('Pause a running timer', function() {
34-
beforeEach(function (done) {
34+
beforeEach(function(done) {
3535
$('#timer').timer();
36-
$('#timer').timer('pause');
36+
$('#timer').timer('pause');
3737
setTimeout(done, 1000);
3838
});
3939

40-
it('Should be true if the async call has completed', function () {
40+
it('Should be true if the async call has completed', function() {
4141
// Even when we wait for a second, the time elapsed shouldnt change
4242
// as we had immediately paused the timer after starting it
4343
expect($('#timer').data('seconds')).toEqual(0);
@@ -46,14 +46,14 @@ describe('Timed functions', function () {
4646

4747
// Pause and Resume a timer
4848
describe('Pause and Resume a timer', function() {
49-
beforeEach(function (done) {
49+
beforeEach(function(done) {
5050
$('#timer').timer();
5151
$('#timer').timer('pause');
5252
expect($('#timer').data('state')).toBe('paused');
5353
setTimeout(done, 1000);
5454
});
5555

56-
it('Should be true if the async call has completed', function () {
56+
it('Should be true if the async call has completed', function() {
5757
$('#timer').timer('resume');
5858
expect($('#timer').data('state')).toBe('running');
5959
});
@@ -62,7 +62,7 @@ describe('Timed functions', function () {
6262
// Execute a function after a set time
6363
describe('Execute a function after a set time', function() {
6464
var flag;
65-
beforeEach(function (done) {
65+
beforeEach(function(done) {
6666
$('#timer').timer({
6767
callback: function() {
6868
flag = true;
@@ -72,15 +72,15 @@ describe('Timed functions', function () {
7272
setTimeout(done, 1000);
7373
});
7474

75-
it('Should call a function after the provided duration is complete', function () {
75+
it('Should call a function after the provided duration is complete', function() {
7676
expect(flag).toBe(true);
7777
});
7878
});
7979

8080
// Execute a function after a set time
8181
describe('Execute a function after a set time provided in pretty syntax', function() {
8282
var flag;
83-
beforeEach(function (done) {
83+
beforeEach(function(done) {
8484
$('#timer').timer({
8585
callback: function() {
8686
flag = true;
@@ -91,7 +91,7 @@ describe('Timed functions', function () {
9191
setTimeout(done, 1000);
9292
});
9393

94-
it('Should call a function after the provided duration is complete', function () {
94+
it('Should call a function after the provided duration is complete', function() {
9595
expect(flag).toBe(true);
9696
expect($('#timer')).toContainText('1:40 min');
9797
});

0 commit comments

Comments
 (0)