Skip to content

Commit c334201

Browse files
committed
Merge pull request #9 from KSDaemon/master
Make a title and icon attributes optional for a hash-table API call - Thanks to KSDaemon
2 parents e539736 + a87bf0b commit c334201

5 files changed

Lines changed: 99 additions & 5 deletions

File tree

Gruntfile.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = function(grunt) {
2+
// Project configuration.
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON('package.json'),
5+
uglify: {
6+
options: {
7+
compress: {
8+
drop_console: true
9+
},
10+
preserveComments: 'some'
11+
},
12+
default: {
13+
files: {
14+
'bootstrap-growl.min.js': ['bootstrap-growl.js']
15+
}
16+
}
17+
},
18+
jshint: {
19+
options: {
20+
jshintrc: 'jshintrc.json'
21+
},
22+
default: {
23+
src: 'bootstrap-growl.js'
24+
}
25+
}
26+
});
27+
28+
grunt.loadNpmTasks('grunt-contrib-uglify');
29+
grunt.loadNpmTasks('grunt-contrib-jshint');
30+
31+
grunt.registerTask('test', ['jshint']);
32+
grunt.registerTask('default', ['uglify']);
33+
};

bootstrap-growl.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
if (Object.prototype.toString.call(content) == "[object Object]") {
1515
message = content.message;
16-
title = " "+content.title+" ";
17-
icon = content.icon;
16+
title = content.title ? " "+content.title+" " : null;
17+
icon = content.icon ? content.icon : null;
1818
}else{
1919
message = content;
2020
}
@@ -31,7 +31,7 @@
3131

3232
/* ===== BUILD GROWL CONTAINER ===== */
3333
growlClass = "bootstrap-growl-" + options.position.from + "-" + options.position.align;
34-
$growl = $(options.template.container);
34+
$growl = $(options.template.container);
3535
$growl.addClass(growlClass);
3636

3737
if (options.type) {
@@ -138,7 +138,7 @@
138138
}
139139
});
140140

141-
$growl.bind('closed.bs.alert', function (event) {
141+
$growl.bind('closed.bs.alert', function (event) {
142142
if (options.onGrowlClosed) {
143143
options.onGrowlClosed(event);
144144
}

bootstrap-growl.min.js

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

jshintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"bitwise": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"forin": true,
6+
"freeze": true,
7+
"immed": true,
8+
"latedef": true,
9+
"noarg": true,
10+
"noempty": true,
11+
"nonbsp": true,
12+
"nonew": true,
13+
"undef": true,
14+
"unused": true,
15+
"strict": false,
16+
"trailing": true,
17+
"maxparams": 5,
18+
"sub": true,
19+
"devel": true,
20+
"browser": true,
21+
22+
"globals": {
23+
"jQuery": false
24+
}
25+
26+
}

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "bootstrap-growl",
3+
"version": "1.0.6",
4+
"description": "This is a simple plugin that turns standard Bootstrap alerts into \"Growl-like\" notifications.",
5+
"repository": {
6+
"type": "git",
7+
"url": "git://github.com/mouse0270/bootstrap-growl.git"
8+
},
9+
"keywords": [
10+
"bootstrap",
11+
"growl"
12+
],
13+
"author": "mouse0270 <rmcintosh@remabledesigns.com>",
14+
"license": "MIT",
15+
"bugs": {
16+
"url": "https://github.com/mouse0270/bootstrap-growl/issues"
17+
},
18+
"homepage": "http://bootstrap-growl.remabledesigns.com/",
19+
"main": "bootstrap-growl.js",
20+
"directories": {
21+
"test": "test"
22+
},
23+
"dependencies": {
24+
"grunt": "~0.4.4",
25+
"grunt-contrib-uglify": "~0.4.0"
26+
},
27+
"devDependencies": {
28+
"grunt": "~0.4.4",
29+
"grunt-contrib-uglify": "^0.4.0",
30+
"grunt-contrib-jshint": "^0.10.0"
31+
}
32+
}

0 commit comments

Comments
 (0)