Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (35 sloc) 1.47 KB
{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia cms_js_tags cms_admin %}
{% comment %}
- This template is used whenever a plugin has been saved
{% endcomment %}
{% block extrahead %}
<script type="text/javascript" src="{% admin_static_url %}js/jquery.min.js"></script>
{{ media }}
{% endblock %}
{% block title %}{% trans "Change a page" %}{% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<script type="text/javascript">
jQuery(document).ready(function ($) {
// determine how to handle the plugin call
var type = '{% if deleted %}delete{% else %}add{% endif %}';
if(window.parent.CMS) type = 'popup';
// extra context that can be passed to the calling function
// TODO: context should be passed through the backend
var context = {
'window': window,
'plugin_id': '{{ plugin_id }}', // used for everything
'plugin_type': {{ type }}, // used for hide_iframe
'plugin_name': {{ name }}, // used for hide_iframe
'plugin_icon': '{{ icon }}', // used for wysiwyg
'plugin_desc': '{{ alt }}', // used for wysiwyg
'timeout': {{ window_close_timeout|default:0 }},
'message': '{% if cancel %}{% trans "Your changes to this plugin have not been saved." %}{% else %}{% trans "Plugin saved successfully." %}{% endif %}'
};
// determing if we are inside the current window or in a popup
if(window.CMS) CMS.API.Helpers.Save(type, context);
if(window.parent.CMS) window.parent.CMS.API.Helpers.Save(type, context);
});
</script>
{% endblock %}
Something went wrong with that request. Please try again.