!function(e){foswiki.Edit={validateSuppressed:!1},foswiki.Edit.validateMandatoryFields=function(){if(foswiki.Edit.validateSuppressed)return!0;var i=[];return e("select.foswikiMandatory").each((function(e,t){var n,a=!1;for(n=0;n<t.options.length;n+=1)if(t.options[n].selected){a=!0;break}a||i.push("The required form field '"+t.name+"' has no value.")})),e("textarea.foswikiMandatory, input.foswikiMandatory").each((function(e,t){null!==t.value&&0!==t.value.length||i.push("The required form field '"+t.name+"' has no value.")})),!(i.length>0)||(alert(i.join("\n")),!1)},e((function(){try{document.main.text.focus()}catch(e){}e(document.forms[name="main"]).submit((function(e){return foswiki.Edit.validateMandatoryFields()})),e(".foswikiTextarea").keydown((function(e){var i;return e.keyCode&&(i=e.keyCode),27!==i})),e(".foswikiButtonCancel").click((function(e){foswiki.Edit.validateSuppressed=!0}))}))}(jQuery);
