text: /**!
   * KEditor - Kademi content editor
   * @copyright: Kademi (http://kademi.co)
   * @author: Kademi (http://kademi.co)
   * @version: 1.1.7
   * @dependencies: $, $.fn.draggable, $.fn.droppable, $.fn.sortable, Bootstrap (optional), FontAwesome (optional)
   */
  !function(o){var t=o.keditor,e=t.log;t.components.form={initFormBuilder:function(o){var t=this,e=o.find(".form-builder-area"),n=o.find(".form-data"),i=o.find(".form-content");o.find(".keditor-component-content").prepend('<p class="form-builder-tools" style="text-align: right;">    <a href="#" class="btn btn-primary btn-preview-form">Preview form</a>     <a href="#" class="btn btn-info btn-edit-form disabled">Edit form</a></p>');var a=o.find(".btn-edit-form"),l=o.find(".btn-preview-form");e.formBuilder({disableInjectedStyle:!0,showActionButtons:!1,dataType:"json",formData:n.html(),disableFields:["autocomplete","paragraph","header"],disabledAttrs:["access"],typeUserDisabledAttrs:{"checkbox-group":["toggle","inline"]}}),a.on("click",function(o){o.preventDefault(),a.hasClass("disabled")||(e.show(),i.hide(),a.addClass("disabled"),l.removeClass("disabled"))}),l.on("click",function(n){n.preventDefault(),l.hasClass("disabled")||(t.renderForm(o),e.hide(),i.show(),a.removeClass("disabled"),l.addClass("disabled"))})},renderForm:function(t,e){var n=t.find(".form-content");if(!e){var i=t.find(".form-builder-area");e=i.data("formBuilder")}n.formRender({dataType:"json",formData:e.actions.getData("json")}),n.hasClass("form-horizontal")&&n.children("div").each(function(){var t=o(this),e=n.attr("data-grid")||"4-8";if(e=e.split("-"),t.attr("class"))if(t.hasClass("fb-button"))t.find("button").wrap('<div class="col-sm-'+e[1]+" col-sm-offset-"+e[0]+'"></div>');else{var i=t.children("label"),a=t.children("input, select, textarea"),l=t.children("div");i.addClass("control-label col-sm-"+e[0]),l.length>0?l.addClass("col-sm-"+e[1]):a.addClass("form-control").wrap('<div class="col-sm-'+e[1]+'"></div>')}})},init:function(t,n,i,a){e('init "form" component',i);var l=i.find(".keditor-component-content"),r=i.find(".form-builder-area"),s=i.find(".form-content"),d=i.find(".form-data");0===d.length&&l.append('<div class="form-data" style="display: none !important;"></div>'),0===s.length?l.append('<form class="form-content" style="display: none !important;"></form>'):s.hide(),0===r.length&&(r=o('<div class="form-builder-area clearfix"></div>'),l.append(r)),this.initFormBuilder(i)},getContent:function(t,n){e('getContent "form" component',t);var i=this,a=t.find(".keditor-component-content"),l=t.find(".form-data"),r=o("#"+t.attr("id")).find(".form-builder-area"),s=r.data("formBuilder");return i.renderForm(t,s),l.html(s.actions.getData("json")),t.find(".form-builder-area, .form-builder-tools").remove(),t.find(".form-content").show(),a.html()},settingEnabled:!0,settingTitle:"Form Settings",initSettingForm:function(o,t){e('initSettingForm "form" component');var n=this;o.html('<div class="form-horizontal">    <div class="form-group">        <label class="col-sm-12">Action</label>        <div class="col-sm-12">            <input type="text" class="form-control txt-form-action" />        </div>    </div>    <div class="form-group">        <label class="col-sm-12">Method</label>        <div class="col-sm-12">            <select class="form-control select-method">                <option value="get">Get</option>                <option value="post">Post</option>                <option value="put">Put</option>                <option value="delete">Delete</option>            </select>        </div>    </div>    <div class="form-group">        <label class="col-sm-12">Enctype</label>        <div class="col-sm-12">            <select class="form-control select-enctype">                <option value="text/plain">text/plain</option>                <option value="multipart/form-data">multipart/form-data</option>                <option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>            </select>        </div>    </div>    <div class="form-group">        <label class="col-sm-12">Layout</label>        <div class="col-sm-12">            <select class="form-control select-layout">                <option value="">Normal</option>                <option value="form-horizontal">Horizontal</option>                <option value="form-inline">Inline</option>            </select>        </div>    </div>    <div class="form-group select-grid-wrapper">        <label class="col-sm-12">Grid setting</label>        <div class="col-sm-12">            <select class="form-control select-grid">                <option value="2-10">col-2 col-10</option>                <option value="3-9">col-3 col-9</option>                <option value="4-8">col-4 col-8</option>                <option value="5-7">col-5 col-7</option>                <option value="6-6">col-6 col-6</option>            </select>            <small class="help-block">This setting is for width of label and control with number of cols as unit</small>        </div>    </div></div>'),o.find(".txt-form-action").on("change",function(){var o=t.getSettingComponent(),e=o.find(".form-content");e.attr("action",this.value)}),o.find(".select-method").on("change",function(){var o=t.getSettingComponent(),e=o.find(".form-content");e.attr("action",this.value)}),o.find(".select-enctype").on("change",function(){var o=t.getSettingComponent(),e=o.find(".form-content");e.attr("enctype",this.value)}),o.find(".select-layout").on("change",function(){var e=t.getSettingComponent(),i=e.find(".form-content");i.removeClass("form-inline form-horizontal"),this.value&&i.addClass(this.value),n.renderForm(e),o.find(".select-grid-wrapper").css("display","form-horizontal"===this.value?"block":"none")}),o.find(".select-grid").on("change",function(){var o=t.getSettingComponent(),e=o.find(".form-content");e.attr("data-grid",this.value),n.renderForm(o)})},showSettingForm:function(o,t,n){e('showSettingForm "form" component',t);var i=t.find(".form-content"),a="";i.hasClass("form-inline")?a="form-inline":i.hasClass("form-horizontal")&&(a="form-horizontal"),o.find(".txt-form-action").val(i.attr("action")||""),o.find(".select-method").val(i.attr("method")||"get"),o.find(".select-enctype").val(i.attr("enctype")),o.find(".select-layout").val(a),o.find(".select-grid-wrapper").css("display","form-horizontal"===a?"block":"none"),o.find(".select-grid").val(i.attr("data-grid")||"4-8")}}}(jQuery);
  //# sourceMappingURL=keditor-component-form.min.js.map
  