From c14ee731e94304b8646baceac9fd080fa98b6aae Mon Sep 17 00:00:00 2001 From: benjaoming Date: Wed, 9 Jan 2013 01:33:47 +0100 Subject: [PATCH] Use JS to save article form data on all sidebar plugin forms --- .../templates/wiki/plugins/images/sidebar.html | 10 ---------- wiki/templates/wiki/includes/editor_sidebar.html | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wiki/plugins/images/templates/wiki/plugins/images/sidebar.html b/wiki/plugins/images/templates/wiki/plugins/images/sidebar.html index cccf93f1..1a210ec2 100644 --- a/wiki/plugins/images/templates/wiki/plugins/images/sidebar.html +++ b/wiki/plugins/images/templates/wiki/plugins/images/sidebar.html @@ -13,16 +13,6 @@ function insert_image(image_id) { $('#id_content').insertAtCaret(imagetag+'\n\n'); } } - -$(document).ready( function() { - $('.sidebar-form').each(function () { - $(this).submit( function() { - this.unsaved_article_title.value = $('#id_title').val(); - this.unsaved_article_content.value = $('#id_content').val(); - }); - }); -}); - {% endaddtoblock %} diff --git a/wiki/templates/wiki/includes/editor_sidebar.html b/wiki/templates/wiki/includes/editor_sidebar.html index 10cac65c..5b31c28f 100644 --- a/wiki/templates/wiki/includes/editor_sidebar.html +++ b/wiki/templates/wiki/includes/editor_sidebar.html @@ -1,3 +1,16 @@ +{% addtoblock "js" %} + +{% endaddtoblock %} +
{% for plugin, plugin_form in sidebar %} -- 2.45.2