define(["require","exports","../shared/DraftSavingEngine","../shared/AntragsgruenEditor"],function(t,n,i,a){"use strict";var e=function(){function t(t){this.$form=t,$(".input-group.date").datetimepicker({locale:$("html").attr("lang"),format:"L"}),$(".wysiwyg-textarea").each(this.initWysiwyg.bind(this)),$(".form-group.plain-text").each(this.initPlainTextFormGroup.bind(this));var n=$("#draftHint"),a=n.data("motion-type"),e=n.data("motion-id");new i.DraftSavingEngine(t,n,"motion_"+a+"_"+e)}return t.prototype.initWysiwyg=function(t,n){var i=$(n),e=i.find(".texteditor"),r=new a.AntragsgruenEditor(e.attr("id"));e.parents("form").submit(function(){e.parent().find("textarea").val(r.getEditor().getData())})},t.prototype.initPlainTextFormGroup=function(t,n){var i=$(n),a=i.find("input.form-control");if(0!=i.data("max-len")){var e=i.data("max-len"),r=!1,o=i.find(".maxLenTooLong"),d=i.parents("form").first().find("button[type=submit]"),s=i.find(".maxLenHint .counter");e<0&&(r=!0,e*=-1),a.on("keyup change",function(){var t=a.val().length;s.text(t),t>e?(o.removeClass("hidden"),r||d.prop("disabled",!0)):(o.addClass("hidden"),r||d.prop("disabled",!1))}).trigger("change")}},t}();n.MotionEditForm=e});
//# sourceMappingURL=MotionEditForm.js.map
