{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}

{% block title %}{% trans "Change a page" %}{% endblock %}

{% block extrahead %}
	<script type="text/javascript" src="{% admin_media_prefix %}js/jquery.min.js"></script>
	{{ media }}
{% endblock %}

{% block content_title %}{% endblock %}

{% block content %}
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function ($) {
	// if it is an iframe
	if(window.parent != self) {
		if (typeof window.parent.CMS === 'undefined'){
			// backend admin
			parent.hide_iframe({{ plugin.pk }}, "{{ type }}", "{{ name }}", "{% trans "Plugin saved successfully." %}");
		} else {
			// frontend edit
			setTimeout(function () { window.parent.CMS.API.Helpers.reloadBrowser(); }, 1000);
		}
	} else {
		opener.dismissEditPluginPopup(window, "{{ plugin_id }}", "{{ icon }}", "{{ alt }}");
	}
});
//]]>
</script>
{% endblock %}