text: 
  $(function(){if(Modernizr.touch){var a=$(".focus-highlight");a.length&&a.find("td, th").attr("tabindex","1").on("touchstart",function(){$(this).focus()}),$(".tablesorter").find("th").addClass("needsclick")}table.table()}),table={table:function(){var c=$("#table"),d={container:$(".ts_pager"),fixedHeight:!0,removeRows:!1,output:"{startRow} - {endRow} / {filteredRows} ({totalRows})",ajaxUrl:base_url+"master/parts/get_list?page={page}&size={size}&{filterList:fcol}&{sortList:col}",ajaxProcessing:function(g){if(g&&g.hasOwnProperty("rows")){var i,a,o,l,k=g.rows,m=g.total_rows,f=g.headers,h=f.join(",").replace(/\s+/g,"").split(","),n=[],j=k.length;for(a=0;a<j;a++){o=[];for(l in k[a]){if(typeof(l)==="string"){i=$.inArray(l,h);if(i>=0){o[i]=k[a][l]}}}n.push(o)}return[m,n,f]}},processAjaxOnInit:true,updateArrows:true,page:0,size:10,savePages:true,pageReset:0,countChildRows:false,};var b=c.tablesorter({theme:"altair",widthFixed:!0,widgets:["zebra","filter",],sortList:[[1,0]],sortReset:true,sortRestart:true,}).tablesorterPager(d);$(".pagesize.ts_selectize").after('<div class="selectize_fix"></div>').selectize({hideSelected:!0,onDropdownOpen:function(a){a.hide().velocity("slideDown",{duration:200,easing:easing_swiftOut})},onDropdownClose:function(a){a.show().velocity("slideUp",{duration:200,easing:easing_swiftOut}),$(".uk-tooltip").hide(),"undefined"!=typeof selectizeObj&&selectizeObj.data("selectize")&&(selectizePage=selectizeObj[0].selectize,selectizePage.destroy(),$(".ts_gotoPage").next(".selectize_fix").remove(),setTimeout(function(){e()}))}}),c.on("click",".ts_remove_row",function(g){g.preventDefault();var f=$(this);var a=f.attr("href");UIkit.modal.confirm("Are you sure want to delete '"+f.attr("data-name")+"'?",function(){$.ajax({url:a,method:"post",success:function(h){h=JSON.parse(h);showNotify(h.message,h.status);if(h.status=="success"){f.closest("tr").remove(),b.trigger("update")}}})},{labels:{Ok:"Delete"}})})},};$("#type").selectize({onDropdownOpen:function(a){a.hide().velocity("slideDown",{begin:function(){a.css({"margin-top":"0"})},duration:200,easing:easing_swiftOut})},onDropdownClose:function(a){a.show().velocity("slideUp",{complete:function(){a.css({"margin-top":""})},duration:200,easing:easing_swiftOut})}});$("#unit").selectize({onDropdownOpen:function(a){a.hide().velocity("slideDown",{begin:function(){a.css({"margin-top":"0"})},duration:200,easing:easing_swiftOut})},onDropdownClose:function(a){a.show().velocity("slideUp",{complete:function(){a.css({"margin-top":""})},duration:200,easing:easing_swiftOut})}});altair_forms.parsley_validation_config();$(function(){altair_form_validation.init()}),altair_form_validation={init:function(){var a=$("#form-modal");a.parsley().on("form:validated",function(){altair_md.update_input(a.find(".md-input-danger"))}).on("field:validated",function(b){$(b.$element).hasClass("md-input")&&altair_md.update_input($(b.$element))}),window.Parsley.on("field:validate",function(){var b=$(this.$element).closest(".md-input-wrapper").siblings(".error_server_side");b&&b.hide()})}};$("body").on("click","#btn-add",function(a){a.preventDefault();showModal("form");$("#save_method").val("add");$("#id").val("");$("#id").removeAttr("readonly");$("#name").val("");$("#type")[0].selectize.setValue("");$("#unit")[0].selectize.setValue("");$("#cost").val("0");$("#price").val("0");$("#form-modal input[type=text]").each(function(){if($(this).val().length==0){$(this).parent("div.md-input-wrapper").removeClass("md-input-filled")}})});$("body").on("click",".btn-edit",function(a){a.preventDefault();$("#save_method").val("edit");var b=$(this).attr("data-id");$.ajax({url:current_url+"/get/"+b,method:"post",success:function(c){var d=JSON.parse(c);$("#id").val(d.id);$("#id").attr("readonly","readonly");$("#name").val(d.name);$("#type")[0].selectize.setValue(d.type);$("#unit")[0].selectize.setValue(d.unit);$("#cost").val(d.cost);$("#price").val(d.price);$("#form-modal input[type=text]").each(function(){if($(this).val().length>0){$(this).parent("div.md-input-wrapper").addClass("md-input-filled")}});showModal("form")}})});