/*! Widget: editable - updated 4/4/2017 (v2.28.7) */ !function(e){"use strict";var t=e.tablesorter.editable={namespace:".tseditable",lastEdited:"tseditable-last-edited-cell",editComplete:function(e,n,i,o){e.$table.find("."+t.lastEdited).removeClass(t.lastEdited).trigger(n.editable_editComplete,[e]),o&&setTimeout(function(){i.focus()},50)},selectAll:function(e){setTimeout(function(){if(document.queryCommandSupported("SelectAll"))document.execCommand("selectAll",!1,null);else{var t,n;document.body.createTextRange?((t=document.body.createTextRange()).moveToElementText(e),t.select()):window.getSelection&&(n=window.getSelection(),(t=document.createRange()).selectNodeContents(e),n.removeAllRanges(),n.addRange(t))}},100)},getColumns:function(t,n){var i,o,a,l,d,s=n.editable_columns,r=[];if("string"==typeof s)for(l=(i=s.replace(/\s+/,"").split(/,/)).length-1;l>=0;){if(i[l].indexOf("-")>=0)for(a=i[l].split("-"),(o=parseInt(a[0],10)||0)>(a=parseInt(a[1],10)||t.columns-1)&&(d=o,o=a,a=d);o<=a;o++)r.push("td:nth-child("+(o+1)+")");else r.push("td:nth-child("+((parseInt(i[l],10)||0)+1)+")");l--}else if(e.isArray(s))for(l=s.length,o=0;o").wrapInner(i.editable_wrapContent).children().length||e.isFunction(i.editable_wrapContent),f=t.getColumns(n,i).join(",");for(n.$tbodies.find(f).find("[contenteditable]").prop("contenteditable",!1),d=(a=n.$tbodies.find(f).not("."+i.editable_noEdit)).length,l=0;l"+n.html()+"",n.html(e(t).text().trim()))},0)})},destroy:function(e,n){var i=t.namespace,o=t.getColumns(e,n),a="updateComplete pagerComplete ".split(" ").join(i+" ").replace(/\s+/g," ");e.$table.off(a),a="focus focusout keydown paste ".split(" ").join(i+" ").replace(/\s+/g," "),e.$tbodies.off(a).find(o.join(",")).find("[contenteditable]").prop("contenteditable",!1)}};e.tablesorter.addWidget({id:"editable",options:{editable_columns:[],editable_enterToAccept:!0,editable_autoAccept:!0,editable_autoResort:!1,editable_wrapContent:"
",editable_trimContent:!0,editable_validate:null,editable_focused:null,editable_blur:null,editable_selectAll:!1,editable_noEdit:"no-edit",editable_editComplete:"editComplete"},init:function(e,n,i,o){o.editable_columns.length&&(t.update(i,o),t.bindEvents(i,o))},remove:function(e,n,i,o){o||t.destroy(n,i)}})}(jQuery);