text: $(document).ready(function(){$("#__x_nb_wc").on("change.select.nabu",function(b){$(this).closest("form").get(0).submit()});$('[data-toggle="nabu-table"]').each(function(){var b=this;nabu.loadLibrary("Table",function(){if(b.nabuTable){b.nabuTable.addEventListener(new Nabu.Event({onLoadEditor:function(c){$('[data-toggle="nabu-lang-selector"]').nabuLangSelector("refresh")}}))}})});$('[data-toggle="nabu-tree"]').each(function(){var b=this;nabu.loadLibrary("Tree",function(){if(b.nabuTree){b.nabuTree.addEventListener(new Nabu.Event({onLoadEditor:function(c){$('[data-toggle="nabu-lang-selector"]').nabuLangSelector("refresh")}}))}})});var a=$(".modal form").closest(".modal");a.find("form").each(function(){this.reset()});a.find("form").on("response.form.nabu",function(c,d){$(this).find(".modal-steps").addClass("hide");$(this).find(".modal-panels").removeClass("hide");$(this).find(".modal-panels .modal-panel").addClass("hide");var b=d.response.json;if(b.result.status==="OK"){$(this).find('.modal-panels .modal-panel[data-action="success"]').removeClass("hide")}else{$(this).find('.modal-panels .modal-panel[data-action="error"]').removeClass("hide")}if(b.data){$(this).data("id",b.data.id)}return true}).on("beforesubmit.form.nabu",function(c,d){if(typeof CKEDITOR!=="undefined"){for(var b in CKEDITOR.instances){CKEDITOR.instances[b].updateElement()}}return true});a.find('form [data-toggle="modal-btn-editor"]').on("click",function(){var d=$(this).closest("form").data("id");var c=$(this).data("editor");var b=$.sprintf(c,d);document.location=b});a=$(".modal .modal-steps").closest(".modal");a.on("show.bs.modal",function(c){var b=$(this);b.find(".modal-panels").addClass("hide");b.find(".modal-panels .modal-panel").addClass("hide");b.find(".modal-steps").removeClass("hide");b.find(".modal-steps .modal-step").addClass("hide");b.find('.modal-steps .modal-step[data-step="1"]').removeClass("hide");b.find("form").each(function(){this.reset()})})});