From 657974b5189719ee9b214befdd2fd5f2f3391bed Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 16:40:44 +0000 Subject: [PATCH] move saved revs notification to gritter --- src/locales/en.json | 1 + src/static/js/pad_savedrevs.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index cafbd76e5..23bb3a040 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -121,6 +121,7 @@ "timeslider.unnamedauthors": "{{num}} unnamed {[plural(num) one: author, other: authors ]}", "pad.savedrevs.marked": "This revision is now marked as a saved revision", + "pad.savedrevs.timeslider": "You can see saved revisions by visiting the timeslider", "pad.userlist.entername": "Enter your name", "pad.userlist.unnamed": "unnamed", "pad.userlist.guest": "Guest", diff --git a/src/static/js/pad_savedrevs.js b/src/static/js/pad_savedrevs.js index e1552c27c..34323b22f 100644 --- a/src/static/js/pad_savedrevs.js +++ b/src/static/js/pad_savedrevs.js @@ -18,7 +18,16 @@ var pad; exports.saveNow = function(){ pad.collabClient.sendMessage({"type": "SAVE_REVISION"}); - alert(_("pad.savedrevs.marked")); + $.gritter.add({ + // (string | mandatory) the heading of the notification + title: _("pad.savedrevs.marked"), + // (string | mandatory) the text inside the notification + text: _("pad.savedrevs.timeslider") || "You can view saved revisions in the timeslider", + // (bool | optional) if you want it to fade out on its own or just sit there + sticky: false, + // (int | optional) the time you want it to be alive for before fading out + time: '2000' + }); } exports.init = function(_pad){