{% load cms_static %}
<script>
window.CMS || window.parent.CMS || document.write(
    '<script src="{% static_with_version "cms/js/dist/bundle.admin.base.min.js" %}" type="text/javascript"><\/script>'
);
</script>
<script>
    // we have a special case here cause the CMS namespace
    // can be either inside the current window or the parent
    (function(Window) {
        Window.CMS.$(document).ready(function () {
            // make sure we're doing after the "modal" mechanism kicked in
            setTimeout(function () {
                // save current plugin
                Window.CMS.API.Helpers.onPluginSave();
            }, 100);
        });
    })(window.parent || window);
</script>