1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-27 17:28:39 +00:00

Merge pull request #1257 from freddyb/dev-autoclose

Dev autoclose
This commit is contained in:
Thomas Citharel 2015-07-30 13:51:55 +02:00
commit 4e8f6a35db

View file

@ -1,6 +1,15 @@
$(document).ready(function() {
current_url = window.location.href
if (current_url.match("&closewin=true")) {
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();
}
});