aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/_global/js/autoClose.js
blob: c3ce744f1585d7298616ee3318c49ddab45866fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$(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();
	}
});