From: Mike Frysinger Date: Tue, 21 Jan 2014 05:52:40 +0000 (-0500) Subject: fix notification message when deleting old history X-Git-Tag: v1.5.2 X-Git-Url: https://git.wh0rd.org/?p=chrome-ext%2Fclearhistory-advance-fork.git;a=commitdiff_plain;h=016d65473cf14e5153a497bd043cd6e1b62d860c fix notification message when deleting old history --- diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 7ea4116..13074bf 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -22,13 +22,20 @@ "optionsAutoclear": {"message": "Automatically purge old entries"}, "confirmPrompt": {"message": "Are you sure you want to delete the history?"}, "notificationTitle": {"message": "History deleted successfully!"}, - "notificationTime": { + "notificationTimeNewer": { "message": "for the last $num$ $units$", "placeholders": { "num": {"content": "$1"}, "units": {"content": "$2"} } }, + "notificationTimeOlder": { + "message": "older than $num$ $units$", + "placeholders": { + "num": {"content": "$1"}, + "units": {"content": "$2"} + } + }, "notificationTimeAll": {"message": "from the beginning of time"}, "notificationBody": { "message": "History deleted $when$.", diff --git a/javascript/clearhistory.js b/javascript/clearhistory.js index f614fff..28eb2b0 100644 --- a/javascript/clearhistory.js +++ b/javascript/clearhistory.js @@ -67,10 +67,10 @@ function clearDownloads(s) { function didClearHistory(s) { var time = ~~(s.time) || CONSTANTS.DEFAULT_TIME; time = getUnitsForTime(time); - var timeString = (time.time === -1) ? - chrome.i18n.getMessage('notificationTimeAll') : - chrome.i18n.getMessage('notificationTime', - [time.time, time.units]); + var timeMsg = (time.time === -1) ? 'notificationTimeAll' : + (s.timeStart === CONSTANTS.YES) ? 'notificationTimeNewer' : + 'notificationTimeOlder'; + var timeString = chrome.i18n.getMessage(timeMsg, [time.time, time.units]); var message = chrome.i18n.getMessage('notificationBody', timeString); var notification = webkitNotifications.createNotification( chrome.extension.getURL('/images/icon48.png'),