Skip to content

Commit

Permalink
change default icon url
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiegurari committed Sep 11, 2016
1 parent 862d634 commit bbebcad
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ See [contributing guide](.github/CONTRIBUTING.md)

| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2016-09-11 | v1.0.8 | Maintenance |
| 2016-09-11 | v1.0.9 | Maintenance |
| 2016-09-10 | v1.0.6 | Default to website favicon.ico if icon not provided in options |
| 2016-09-07 | v1.0.4 | Callback is now optional |
| 2016-09-07 | v1.0.3 | Maintenance |
Expand Down
6 changes: 3 additions & 3 deletions angular-web-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
*
* @param {string} title - The notification title text (defaulted to empty string if null is provided)
* @param {object} options - Holds the notification data (web notification API spec for more info)
* @param {string} [options.icon=favicon.ico] - The notification icon (defaults to the website favicon.ico)
* @param {string} [options.icon=/favicon.ico] - The notification icon (defaults to the website favicon.ico)
* @param {number} [options.autoClose] - Auto closes the notification after the provided amount of millies (0 or undefined for no auto close)
* @param {function} [options.onClick] - An optional onclick event handler
* @returns {function} The hide notification function
Expand All @@ -139,7 +139,7 @@

//defaults the notification icon to the website favicon.ico
if (!options.icon) {
options.icon = document.location.protocol + '//' + document.location.host + '/favicon.ico';
options.icon = '/favicon.ico';
}

var notification = notifyLib.createNotification(title, options);
Expand Down Expand Up @@ -212,7 +212,7 @@
* @public
* @param {string} [title] - The notification title text (defaulted to empty string if null is provided)
* @param {object} [options] - Holds the notification data (web notification API spec for more info)
* @param {string} [options.icon=favicon.ico] - The notification icon (defaults to the website favicon.ico)
* @param {string} [options.icon=/favicon.ico] - The notification icon (defaults to the website favicon.ico)
* @param {number} [options.autoClose] - Auto closes the notification after the provided amount of millies (0 or undefined for no auto close)
* @param {function} [options.onClick] - An optional onclick event handler
* @param {ShowNotificationCallback} [callback] - Called after the show is handled.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-web-notification",
"version": "1.0.8",
"version": "1.0.9",
"description": "AngularJS service for displaying web notifications.",
"authors": [
"Sagie Gur-Ari <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2016-09-11 | v1.0.8 | Maintenance |
| 2016-09-11 | v1.0.9 | Maintenance |
| 2016-09-10 | v1.0.6 | Default to website favicon.ico if icon not provided in options |
| 2016-09-07 | v1.0.4 | Callback is now optional |
| 2016-09-07 | v1.0.3 | Maintenance |
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ case of no errors) and a 'hide' function which can be used to hide the notificat
| --- | --- | --- | --- |
| [title] | <code>string</code> | | The notification title text (defaulted to empty string if null is provided) |
| [options] | <code>object</code> | | Holds the notification data (web notification API spec for more info) |
| [options.icon] | <code>string</code> | <code>&quot;favicon.ico&quot;</code> | The notification icon (defaults to the website favicon.ico) |
| [options.icon] | <code>string</code> | <code>&quot;/favicon.ico&quot;</code> | The notification icon (defaults to the website favicon.ico) |
| [options.autoClose] | <code>number</code> | | Auto closes the notification after the provided amount of millies (0 or undefined for no auto close) |
| [options.onClick] | <code>function</code> | | An optional onclick event handler |
| [callback] | <code>[ShowNotificationCallback](#ShowNotificationCallback)</code> | | Called after the show is handled. |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-web-notification",
"version": "1.0.8",
"version": "1.0.9",
"description": "AngularJS service for displaying web notifications.",
"author": {
"name": "Sagie Gur-Ari",
Expand Down
9 changes: 4 additions & 5 deletions test/spec/angular-web-notification-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('angular-web-notification', function () {
var emptyValuesValidation = function (title, options) {
assert.equal(title, '');
assert.deepEqual(options, {
icon: 'http://localhost:8080/favicon.ico' //based on karma configuration
icon: '/favicon.ico'
});
};
var validShowValidation = function (error, hide, done) {
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('angular-web-notification', function () {
assert.equal(title, '');
assert.deepEqual(options, {
body: 'no title',
icon: 'http://localhost:8080/favicon.ico' //based on karma configuration
icon: '/favicon.ico'
});
});

Expand All @@ -168,10 +168,9 @@ describe('angular-web-notification', function () {
inject(function (webNotification) {
window.notify.setAllowed(function (title, options) {
assert.equal(title, 'Example Notification');
console.log(options)//TODO RMOVE
assert.deepEqual(options, {
body: 'Notification Text...',
icon: 'http://localhost:8080/favicon.ico' //based on karma configuration
icon: '/favicon.ico'
});
});

Expand All @@ -188,7 +187,7 @@ describe('angular-web-notification', function () {
window.notify.setAllowed(function (title, options) {
assert.equal(title, 'no options');
assert.deepEqual(options, {
icon: 'http://localhost:8080/favicon.ico' //based on karma configuration
icon: '/favicon.ico'
});
});

Expand Down

0 comments on commit bbebcad

Please sign in to comment.