diff options
author | Frederik B <freddyb@users.noreply.github.com> | 2015-07-30 13:49:41 +0200 |
---|---|---|
committer | Frederik B <freddy@flashpad> | 2015-07-30 13:49:41 +0200 |
commit | a7991b2d4c8ca35ed421af62f47e558fce0f8fff (patch) | |
tree | 840f535eb6886e0ba16558017aa041929d297918 /themes | |
parent | 7d6bd5670e8743e10c52b745142320a47d0f1cbe (diff) | |
download | wallabag-a7991b2d4c8ca35ed421af62f47e558fce0f8fff.tar.gz wallabag-a7991b2d4c8ca35ed421af62f47e558fce0f8fff.tar.zst wallabag-a7991b2d4c8ca35ed421af62f47e558fce0f8fff.zip |
Send postMessage to opener before autoclose
Diffstat (limited to 'themes')
-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 | }); |