From 50add90fd9f4620f4a5c049b978a895c9adbed02 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 14 Sep 2015 13:56:02 -0700 Subject: [PATCH] Include image previews in notifications // FREEBIE --- js/chromium.js | 13 +++++++------ js/notifications.js | 6 +++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/js/chromium.js b/js/chromium.js index e719bb95..5d14dcf7 100644 --- a/js/chromium.js +++ b/js/chromium.js @@ -194,12 +194,13 @@ if (chrome) { chrome.notifications.clear('signal'); chrome.notifications.create('signal', { - type : options.type, - title : options.title, - message : options.message || '', // required - iconUrl : options.iconUrl, - items : options.items, - buttons : options.buttons + type : options.type, + title : options.title, + message : options.message || '', // required + iconUrl : options.iconUrl, + imageUrl : options.imageUrl, + items : options.items, + buttons : options.buttons }); } else { var notification = new Notification(options.title, { diff --git a/js/notifications.js b/js/notifications.js index b431f433..8eab0f69 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -61,8 +61,12 @@ }); } else { var m = this.at(0); + var type = 'basic'; + if (m.get('imageUrl')) { + type = 'image'; + } extension.notify({ - type : 'basic', + type : type, title : m.get('title'), message : m.get('message'), iconUrl : m.get('iconUrl'),