1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00
wallabag/themes/_global/js/autoClose.js

16 lines
434 B
JavaScript
Raw Normal View History

$(document).ready(function() {
if (location.search.match("&closewin=true")) {
if (window.opener) {
var msgDiv = $("div.messages");
var msg = msgDiv.children("p").text();
var status = msgDiv.hasClass("success") ?
'success' : 'unknown';
var url = $(".tool.link")[0].href;
window.opener.postMessage({"wallabag-status": status,
"wallabag-msg": msg,
"wallabag-url": url }, "*");
}
window.close();
}
});