X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/22121e7b8f5b96e2a174bfb623adac3f3a4cbab9..530238f609ba71ea112307ea66f0bc486ae11e33:/src/redakcja/static/js/wiki/base.js diff --git a/src/redakcja/static/js/wiki/base.js b/src/redakcja/static/js/wiki/base.js index 32554b17..5262ab72 100644 --- a/src/redakcja/static/js/wiki/base.js +++ b/src/redakcja/static/js/wiki/base.js @@ -339,4 +339,28 @@ } }; + + window.addEventListener("message", (event) => { + event.source.close() + + $.ajax("/editor/editor-user-area/", { + success: function(d) { + $("#user-area")[0].innerHTML = d; + } + }); + }, false); + + $("#login").click(function (e) { + e.preventDefault(); + let h = 600; + let w = 500; + let x = window.screenX + (window.innerWidth - w) / 2; + let y = window.screenY + (window.innerHeight - h) / 2; + window.open( + "/accounts/login/?next=/editor/back", + "login-window", + "width=" + w + " height=" + h + " top=" + y + " left=" + x + ); + }); + })(jQuery);