From f67dc417c3b6f2e234bf7f441d9dfa361a210c3f Mon Sep 17 00:00:00 2001 From: Tim McIver Date: Tue, 21 Jul 2015 21:31:47 -0400 Subject: [PATCH 1/2] Prevent dialog stating "Bookmark added. You can close the window now." from displaying when creating a bookmark using bookmarklet. Addresses issue 136. --- js/bookmarklet.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/js/bookmarklet.js b/js/bookmarklet.js index 93d206ba..f295619b 100644 --- a/js/bookmarklet.js +++ b/js/bookmarklet.js @@ -50,10 +50,7 @@ $(document).ready(function () { }, success: function (data) { if (data.status === 'success') { - $('#bookmarklet_form').html(""); - OC.dialogs.alert( - t("bookmarks", "Bookmark added. You can close the window now."), - t("bookmarks", "Bookmark added successfully"), closeWindow, true); + window.close(); } else { OC.dialogs.alert(t("bookmarks", "Some Error happened."), t("bookmarks", "Error"), null, true); @@ -71,7 +68,3 @@ $(document).ready(function () { }); }); }); - -function closeWindow() { - window.close(); -} From c1b50fd0ce5466721dda738b831f60aa9ad356f5 Mon Sep 17 00:00:00 2001 From: Tim McIver Date: Mon, 24 Aug 2015 15:04:03 -0400 Subject: [PATCH 2/2] Per PR suggestion added a dialog indicating that bookmark was successfully saved which closes after one second. --- js/bookmarklet.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/bookmarklet.js b/js/bookmarklet.js index f295619b..bd589574 100644 --- a/js/bookmarklet.js +++ b/js/bookmarklet.js @@ -50,7 +50,10 @@ $(document).ready(function () { }, success: function (data) { if (data.status === 'success') { - window.close(); + OC.dialogs.message("Bookmark added.", "Success", undefined, [], undefined, true) + _.delay(function() { + window.close(); + }, 1e3); } else { OC.dialogs.alert(t("bookmarks", "Some Error happened."), t("bookmarks", "Error"), null, true);