Commits

mitar committed bd5b092

Added preview button.

Comments (0)

Files changed (2)

cmsplugin_markup/static/cmsplugin_markup/markup.js

 function showhideplugins() {
   (function ($) {
     var plugin = markupPlugins[$('#id_markup').val()];
-    window.console.log($('#id_markup').val());
-    window.console.log(markupPlugins);
     if ((typeof(plugin) !== "undefined") && plugin['textenabled']) {
       $('.iftextplugins').show();
     }

cmsplugin_markup/templates/cmsplugin_markup/markup_plugin_change_form.html

     add_plugin_for_markup(pluginvalue, parent_id, language, '{{ name|escapejs }}')
   }).css("cursor", "pointer").css("margin", "5px");
 
+  $('<input/>').attr({
+    'type': 'button',
+    'value': '{% trans "Refresh preview" %}',
+    'id': 'markup_preview_button_id'
+  }).css({
+    'margin': '0 0 0 5px'
+  }).click(function() {
+    forceAutoPreview = true;
+    $('#id_body').blur();
+  }).insertAfter('#markupfield_form :submit');
+
 {% for p in used_plugins %}
   add_plugin_to_list('{{ p.pk|escapejs }}', '{{ p.get_instance_icon_src|escapejs }}', '{{ p.get_instance_icon_alt|escapejs }}');
 {% endfor %}