From 04808273c8f4c5c9cff398da59bd267c581a04f5 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Sat, 8 Mar 2014 07:08:05 +0100 Subject: [PATCH] Code formatting, corrected notification object on Facebook script --- facebook-notification.user.js | 18 +++++++++--------- googleplus-notification.user.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/facebook-notification.user.js b/facebook-notification.user.js index 36b3c7b..8c42c8f 100644 --- a/facebook-notification.user.js +++ b/facebook-notification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Facebook desktop notification // @namespace https://www.schtobia.de/ -// @version 0.1.0 -// @description Facebook desktop notification (based on HTML5) +// @version 0.1.1 +// @description Facebook desktop notification (based on HTML5) // @include http*://www.facebook.com/* // @include http*://facebook.com/* // @grant GM_getValue @@ -36,18 +36,18 @@ notify = function() newMessages = messagesElement.innerHTML; newNotifications = notificationsElement.innerHTML; - if (newFriendRequests > lastFriendRequests || newMessages > lastMessages || newNotifications > lastNotifications ) + if (newFriendRequests > lastFriendRequests || newMessages > lastMessages || newNotifications > lastNotifications) { var msg= " "; if (newFriendRequests > lastFriendRequests) - msg=msg+"| "+(newFriendRequests-lastFriendRequests)+" new Friend Request(s) |"; + msg = msg + "| " + (newFriendRequests - lastFriendRequests) + " new Friend Request(s) |"; - if (newMessages>lastMessages) - msg=msg+"| "+(newMessages-lastMessages)+" new Message(s) |"; + if (newMessages > lastMessages) + msg = msg + "| " + (newMessages - lastMessages) + " new Message(s) |"; - if (newNotifications>lastNotifications) - msg=msg+"| "+(newNotifications-lastNotifications)+" new Notification(s) |"; + if (newNotifications > lastNotifications) + msg = msg + "| " + (newNotifications - lastNotifications) + " new Notification(s) |"; console.log(GM_info.script.name + ": Trying to set notification...", msg); @@ -55,7 +55,7 @@ notify = function() { "dir" : "auto", "body" : msg, - "icon" : "https://s-static.ak.facebook.com/rsrc.php/yi/r/q9U99v3_saj.ico", + "icon" : "https://s-static.ak.facebook.com/rsrc.php/yi/r/q9U99v3_saj.ico" } ) diff --git a/googleplus-notification.user.js b/googleplus-notification.user.js index 1be0026..02d679d 100644 --- a/googleplus-notification.user.js +++ b/googleplus-notification.user.js @@ -29,7 +29,7 @@ notify = function() { newNotifications = notificationsElement.innerHTML; - if (newNotifications > lastNotifications ) + if (newNotifications > lastNotifications) { var msg = (newNotifications - lastNotifications) + " new Notification(s)";