]> git.immae.eu Git - github/wallabag/wallabag.git/blame - themes/_global/js/autoClose.js
Send postMessage to opener before autoclose
[github/wallabag/wallabag.git] / themes / _global / js / autoClose.js
CommitLineData
363bc4eb 1$(document).ready(function() {
a7991b2d
F
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 }
363bc4eb 13 window.close();
14 }
f616ab60 15});