diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-07-30 13:51:55 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-07-30 13:51:55 +0200 |
commit | 4e8f6a35dbcc7fad790d9f88af237b308857f5db (patch) | |
tree | 7261894ac1d3a7ea43985193a00ddc455cb3e313 /themes/_global | |
parent | 392a37e56a17ef2cc1e1bc02fe9991a56c5a0a97 (diff) | |
parent | f104b384b9d46d35f453c471fba1e0e712066ccd (diff) | |
download | wallabag-4e8f6a35dbcc7fad790d9f88af237b308857f5db.tar.gz wallabag-4e8f6a35dbcc7fad790d9f88af237b308857f5db.tar.zst wallabag-4e8f6a35dbcc7fad790d9f88af237b308857f5db.zip |
Merge pull request #1257 from freddyb/dev-autoclose
Dev autoclose
Diffstat (limited to 'themes/_global')
-rw-r--r-- | themes/_global/js/autoClose.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/themes/_global/js/autoClose.js b/themes/_global/js/autoClose.js index e9145b7e..c3ce744f 100644 --- a/themes/_global/js/autoClose.js +++ b/themes/_global/js/autoClose.js | |||
@@ -1,6 +1,15 @@ | |||
1 | $(document).ready(function() { | 1 | $(document).ready(function() { |
2 | current_url = window.location.href | 2 | if (location.search.match("&closewin=true")) { |
3 | if (current_url.match("&closewin=true")) { | 3 | if (window.opener) { |
4 | var msgDiv = $("div.messages"); | ||
5 | var msg = msgDiv.children("p").text(); | ||
6 | var status = msgDiv.hasClass("success") ? | ||
7 | 'success' : 'unknown'; | ||
8 | var url = $(".tool.link")[0].href; | ||
9 | window.opener.postMessage({"wallabag-status": status, | ||
10 | "wallabag-msg": msg, | ||
11 | "wallabag-url": url }, "*"); | ||
12 | } | ||
4 | window.close(); | 13 | window.close(); |
5 | } | 14 | } |
6 | }); | 15 | }); |