]> git.immae.eu Git - github/wallabag/wallabag.git/blob - themes/_global/js/autoClose.js
Send postMessage to opener before autoclose
[github/wallabag/wallabag.git] / themes / _global / js / autoClose.js
1 $(document).ready(function() {
2 if (location.search.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 }
13 window.close();
14 }
15 });