From cb14c4f89e6089acbb8a3e1be20090b14294ef80 Mon Sep 17 00:00:00 2001 From: maartenkling Date: Thu, 25 Oct 2012 21:46:57 +0200 Subject: [PATCH 1/2] change how to submit the form to stop ff to hang, this fixes #13037 --- .../browser/javascripts/controlpanel.js | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/plone/app/discussion/browser/javascripts/controlpanel.js b/plone/app/discussion/browser/javascripts/controlpanel.js index 19f5898..9266fbe 100644 --- a/plone/app/discussion/browser/javascripts/controlpanel.js +++ b/plone/app/discussion/browser/javascripts/controlpanel.js @@ -7,34 +7,34 @@ // This unnamed function allows us to use $ inside of a block of code // without permanently overwriting $. // http://docs.jquery.com/Using_jQuery_with_Other_Libraries - + /* Disable a control panel setting */ $.disableSettings = function (settings) { $.each(settings, function (intIndex, setting) { setting.addClass('unclickable'); var setting_field = $(setting).find("input,select"); setting_field.attr('disabled', 'disabled'); - }); + }); }; - + /* Enable a control panel setting */ $.enableSettings = function (settings) { $.each(settings, function (intIndex, setting) { setting.removeClass('unclickable'); var setting_field = $(setting).find("input,select"); setting_field.removeAttr('disabled'); - }); + }); }; - + /* Update settings */ $.updateSettings = function () { - + var globally_enabled = $("#content").hasClass("globally_enabled"); var anonymous_comments = $("#content").hasClass("anonymous_comments"); var moderation_enabled = $("#content").hasClass("moderation_enabled"); var moderation_custom = $("#content").hasClass("moderation_custom"); var invalid_mail_setup = $("#content").hasClass("invalid_mail_setup"); - + /* If commenting is globally disabled, disable all settings. */ if (globally_enabled === true) { $.enableSettings([ @@ -60,7 +60,7 @@ $('#formfield-form-widgets-user_notification_enabled') ]); } - + /* If the mail setup is invalid, disable the mail settings. */ if (invalid_mail_setup === true) { $.disableSettings([ @@ -73,14 +73,14 @@ /* Enable mail setup only if discussion is enabled. */ if (globally_enabled === true) { $.enableSettings([ - $('#formfield-form-widgets-moderator_notification_enabled'), - $('#formfield-form-widgets-moderator_email'), + $('#formfield-form-widgets-moderator_notification_enabled'), + $('#formfield-form-widgets-moderator_email'), $('#formfield-form-widgets-user_notification_enabled') ]); } } - - /* If a custom workflow for comments is enabled, disable the moderation + + /* If a custom workflow for comments is enabled, disable the moderation switch. */ if (moderation_custom === true) { $.disableSettings([ @@ -89,20 +89,20 @@ } }; //#JSCOVERAGE_IF 0 - + /************************************************************************** * Window Load Function: Executes when complete page is fully loaded, * including all frames, **************************************************************************/ $(window).load(function () { - + // Update settings on page load $.updateSettings(); - + // Set #content class and update settings afterwards $("input,select").live("change", function (e) { var id = $(this).attr("id"); - if (id === "form-widgets-globally_enabled-0") { + if (id === "form-widgets-globally_enabled-0") { if ($(this).attr("checked") === true) { $("#content").addClass("globally_enabled"); } @@ -112,17 +112,17 @@ $.updateSettings(); } }); - + /********************************************************************** - * Remove the disabled attribute from all form elements before + * Remove the disabled attribute from all form elements before * submitting the form. Otherwise the z3c.form will raise errors on * the required attributes. **********************************************************************/ $("form#DiscussionSettingsEditForm").bind("submit", function (e) { $(this).find("input,select").removeAttr('disabled'); - $(this).submit(); + $("form#DiscussionSettingsEditForm").submit(); }); - + }); //#JSCOVERAGE_ENDIF From f8bf11dc317e6675db935ce3f4817cd66a4b727c Mon Sep 17 00:00:00 2001 From: maartenkling Date: Fri, 26 Oct 2012 08:53:09 +0200 Subject: [PATCH 2/2] update changes --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index ccb7135..18ac0c4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,14 +4,22 @@ Changelog 2.2.1 (unreleased) ------------------ +- Submit form using other jquery selector so FF and Chrome don't crash + fixes #13037 + [maartenkling] + - Remove inline styles, fixes #12399 [maartenkling] + - add fallback border color for i8, fixes #11324 [maartenkling] + - Replace discussionitem_icon.gif with png version. [timo] + - Fix catalog updates for IObjectMovedEvent [gaudenz] + - Fix non-functioning user_notification feature [izak]