<commit_before>(function(){function B(h,i,p,n){var b=this,x={datatype:C,viewrecords:true},s={edit:false,add:false,del:false,afterRefresh:function(){b.refreshData();b.jqgrid.object.trigger("reloadGrid")}};h=h;i=i;this.configuration=p;this.operations=n;this.jqgrid={id:null,object:null,options:null,last_selected_row:null,editable_columns:[],dirty_fields:{},pager:{id:null,options:null}};this.data={data:[],all_data:[],filtered_data:null};var u={enableDisableButtons:function(a){return function(e){function d(f){var c=
jQuery("#"+a.jqgrid.id).jqGrid("getRowData",f),m=r.from(a.data.all_data).equals("columns.key",c.key).select()[0];if(a.jqgrid.dirty_fields[c.key]===undefined)a.jqgrid.dirty_fields[c.key]=[];var o=[],t=[];jQuery.each(c,function(j,q){q!=m.columns[j]?o.push(j):t.push(j)});jQuery.each(o,function(j,q){jQuery.inArray(q,a.jqgrid.dirty_fields[c.key])===-1&&a.jqgrid.dirty_fields[c.key].push(q)});jQuery.each(t,function(j,q){j=jQuery.inArray(q,a.jqgrid.dirty_fields[c.key]);j!==-1&&a.jqgrid.dirty_fields[c.key].splice(j,
1)});a.jqgrid.dirty_fields[c.key].length===0&&delete a.jqgrid.dirty_fields[c.key];jQuery.each(a.operations.buttons,function(j,q){if(q.type==="post_edit"){j=jQuery("#"+a.jqgrid.id+"_buttonOp_"+q.id);A(a.jqgrid.dirty_fields)?j.attr("disabled","disabled"):j.removeAttr("disabled")}})}var k=a.jqgrid.object.jqGrid("getGridParam","multiselect")?"selarrrow":"selrow",g=a.jqgrid.object.jqGrid("getGridParam",k);if(!g instanceof Array)g=[g];if(g.length===1)if(e&&e!==a.jqgrid.last_selected_row){jQuery("#"+a.jqgrid.id).restoreRow(a.jqgrid.last_selected_row);
jQuery("#"+a.jqgrid.id).jqGrid("editRow",e,true,null,null,"clientArray",null,d);a.jqgrid.last_selected_row=e}jQuery.each(a.operations.buttons,function(f,c){f=jQuery("#"+a.jqgrid.id+"_buttonOp_"+c.id);if(c.type!=="post_edit")if(g.length>=c.real_bounds[0]&&g.length<=c.real_bounds[1]){f.removeAttr("disabled");if(c.real_bounds[0]===1&&c.real_bounds[1]===1&&f.data("melange")!==undefined){var m=a.jqgrid.object.jqGrid("getRowData",g[0]);m=r.from(a.data.all_data).equals("columns.key",m.key).select()[0];var o=
f.data("melange").click;f.click(o(m.operations.buttons[c.id].link));f.attr("value",m.operations.buttons[c.id].caption)}}else f.attr("disabled","disabled")})}}(b),global_button_functions:{redirect_simple:function(a){return a.new_window?function(){window.open(a.link)}:function(){window.location.href=a.link}},redirect_custom:function(a){return function(e){return a.new_window?function(){window.open(e)}:function(){window.location.href=e}}},post:function(a){return function(){var e=l.get(a.idx).jqgrid.object.jqGrid("getGridParam",
"multiselect")?"selarrrow":"selrow";e=l.get(a.idx).jqgrid.object.jqGrid("getGridParam",e);e instanceof Array||(e=e===null?[]:[e]);var d=[];if(!(e.length<a.real_bounds[0]||e.length>a.real_bounds[1])){jQuery.each(e,function(k,g){var f=jQuery("#"+l.get(a.idx).jqgrid.id).jqGrid("getRowData",g);r.from(l.get(a.idx).all_data).equals("columns.key",f.key).select();var c={};jQuery.each(a.keys,function(m,o){m=f[o];if(jQuery(m).hasClass("listsnoul"))m=/^<a\b[^>]*>(.*?)<\/a>$/.exec(m)[1];c[o]=m});d.push(c)});
if(a.url==="")a.url=window.location.href;jQuery.post(a.url,{xsrf_token:window.xsrf_token,idx:a.idx,button_id:a.button_id,data:JSON.stringify(d)},function(k){if(a.redirect=="true")try{var g=JSON.parse(k);if(g.data.url!==undefined)window.location.href=g.data.url}catch(f){}k=parseInt(a.refresh,10);if(!isNaN(k)){l.get(k).refreshData();jQuery("#"+l.get(k).jqgrid.id).trigger("reloadGrid")}if(a.refresh=="current"){l.get(a.idx).refreshData();jQuery("#"+l.get(a.idx).jqgrid.id).trigger("reloadGrid")}else if(a.refresh==
"all"){k=l.getAll();jQuery.each(k,function(c,m){m.refreshData();jQuery("#"+l.get(c).jqgrid.id).trigger("reloadGrid")})}})}}},post_edit:function(a){return function(){var e=l.get(a.idx).jqgrid,d={};if(!(e.editable_columns.length===0&&A(e.dirty_fields))){for(var k=e.object.jqGrid("getGridParam","records"),g=1;g<=k;g++){var f=jQuery("#"+e.id).jqGrid("getRowData",g);if(e.dirty_fields[f.key]!==undefined){d[f.key]={};jQuery.each(e.dirty_fields[f.key],function(c,m){d[f.key][m]=f[m]})}}if(a.url==="")a.url=
window.location.href;jQuery.post(a.url,{xsrf_token:window.xsrf_token,idx:a.idx,button_id:a.button_id,data:JSON.stringify(d)},function(c){if(a.redirect=="true")try{var m=JSON.parse(c);if(m.data.url!==undefined)window.location.href=m.data.url}catch(o){}c=parseInt(a.refresh,10);if(!isNaN(c)){l.get(c).refreshData();jQuery("#"+l.get(c).jqgrid.id).trigger("reloadGrid")}if(a.refresh=="current"){l.get(a.idx).refreshData();jQuery("#"+l.get(a.idx).jqgrid.id).trigger("reloadGrid")}else if(a.refresh=="all"){c=
l.getAll();jQuery.each(c,function(t,j){j.refreshData();jQuery("#"+l.get(t).jqgrid.id).trigger("reloadGrid")})}})}}}},row_functions:{redirect_custom:function(a){return function(e,d){return a.new_window||d.which===2||d.which===1&&d.ctrlKey?function(){window.open(e)}:function(){window.location.href=e}}}}},z=function(){jQuery("#"+h).replaceWith(['<p id="temporary_list_placeholder_',i,'"></p>','<table id="'+b.jqgrid.id+'"',' cellpadding="0" cellspacing="0"></table>','<div id="'+b.jqgrid.pager.id+'"',' style="text-align:center"></div>'].join(""))},
y=function(){var a="",e=0,d=function(){var k="?";if(window.location.href.indexOf("?")!==-1)k="&";jQuery.ajax({async:true,cache:false,url:[window.location.href,k,"fmt=json&limit=150",a===""?"":"&start="+a,"&idx=",i].join(""),timeout:6E4,tryCount:1,retryLimit:5,error:function(g){if(g.status==500){this.tryCount++;if(this.tryCount<=this.retryLimit)jQuery.ajax(this);else{jQuery("#temporary_list_placeholder_"+i).html('<span style="color:red">Error retrieving data: please refresh the list or the whole page to try again</span>');
jQuery("#load_"+b.jqgrid.id).hide()}}else{jQuery("#temporary_list_placeholder_"+i).html('<span style="color:red">Error retrieving data: please refresh the list or the whole page to try again</span>');jQuery("#load_"+b.jqgrid.id).hide()}},success:function(g){if(g.data[a]!==undefined){if(b.configuration===null)b.configuration=g.configuration;if(b.operations===null)b.operations=g.operations;jQuery.each(g.data[a],function(){b.data.data.push(this.columns);b.data.all_data.push(this)});b.jqgrid.object===
null?v():b.jqgrid.object.trigger("reloadGrid");if(g.next!=="done"){a=g.next;setTimeout(d,100);e++}else{jQuery("#temporary_list_placeholder_"+i).remove();jQuery("#load_"+b.jqgrid.id).hide()}}else{jQuery("#temporary_list_placeholder_"+i).remove();jQuery("#load_"+b.jqgrid.id).hide();jQuery("#"+b.jqgrid.id)[0].triggerToolbar();jQuery.each(b.configuration.colModel,function(f,c){c.editable!==undefined&&c.editable===true&&b.jqgrid.editable_columns.push(c.name)});jQuery("#t_"+b.jqgrid.id).children().remove();
b.operations!==undefined&&b.operations.buttons!==undefined&&jQuery.each(b.operations.buttons,function(f,c){f=b.jqgrid.id+"_buttonOp_"+c.id;jQuery("#t_"+b.jqgrid.id).append("<input type='button' value='"+c.caption+"' style='float:left' id='"+f+"'/>");c.parameters.idx=i;if(c.type!=="post_edit"){c.real_bounds=c.bounds;var m=c.real_bounds.indexOf("all");if(m!==-1)c.real_bounds[m]=b.jqgrid.object.jqGrid("getGridParam","records");c.parameters.real_bounds=c.real_bounds}if(c.type==="post_edit"||c.real_bounds[0]>
0)jQuery("#"+f).attr("disabled","disabled");c.parameters.button_id=c.id;jQuery("#"+f).click(u.global_button_functions[c.type](c.parameters));c.type=="redirect_custom"&&jQuery("#"+f).data("melange",{click:u.global_button_functions[c.type](c.parameters)})});jQuery("#t_"+b.jqgrid.id).css("padding-bottom","3px");jQuery("#t_"+b.jqgrid.id).append("<input type='button' value='CSV Export' style='float:right;' id='csvexport_"+b.jqgrid.id+"'/>");jQuery("#csvexport_"+b.jqgrid.id).button();jQuery("#csvexport_"+
b.jqgrid.id).click(function(){var f=[];f[0]=[];if(b.data.data[0]!==undefined||b.data.filtered_data[0]!==undefined){var c=b.data.filtered_data||b.data.data;jQuery.each(b.configuration.colNames,function(o,t){o=t;o=o.replace(/\"|&quot;|&#34;/g,'""');if(o.indexOf(",")!==-1||o.indexOf('"')!==-1||o.indexOf("\r\n")!==-1)o='"'+o+'"';f[0].push(o)});f[0]=f[0].join(",");var m=[];jQuery.each(b.configuration.colModel,function(o,t){m.push(t.name)});jQuery.each(c,function(o,t){f[f.length]=[];jQuery.each(m,function(j,
q){j=t[q];if(j===null)j="";if(j===undefined)j="";j=j.toString();q=/^<a\b[^>]*href="(.*?)" \b[^>]*>(.*?)<\/a>$/.exec(j);if(q!==null)j=q[1];j=j.replace(/\"|&quot;|&#34;/g,'""');if(j.indexOf(",")!==-1||j.indexOf('"')!==-1||j.indexOf("\r\n")!==-1)j='"'+j+'"';f[f.length-1].push(j)});f[f.length-1]=f[f.length-1].join(",")});f=f.join("\r\n");jQuery("#csv_dialog").remove();jQuery("body").append(["<div id='csv_dialog' style='display:none'>  <h3>Now you can copy and paste CSV data from the text area to a new file:</h3>  <textarea style='width:450px;height:250px'>",
f,"</textarea></div>"].join(""));jQuery("#csv_dialog").dialog({height:420,width:500,modal:true,buttons:{Close:function(){jQuery(this).dialog("close")}}})}});jQuery("#t_"+b.jqgrid.id).append("<div style='float:right;margin-right:4px;'><input type='checkbox' id='regexp_"+b.jqgrid.id+"'/>RegExp Search</div>");jQuery("#regexp_"+b.jqgrid.id).click(function(){jQuery("#"+b.jqgrid.id).jqGrid().trigger("reloadGrid")});g=jQuery.Event("melange_list_loaded");g.list_object=b;b.jqgrid.object.trigger(g)}}})};setTimeout(d,
100)};this.refreshData=function(){b.data={data:[],all_data:[],filtered_data:null};y()};var v=function(){var a=jQuery.extend(b.configuration,{postData:{my_index:i},onSelectAll:u.enableDisableButtons,onSelectRow:u.enableDisableButtons}),e={caption:"",buttonicon:"ui-icon-calculator",onClickButton:function(){jQuery("#"+b.jqgrid.id).setColumns({colnameview:false,jqModal:true,ShrinkToFit:true});return false},position:"last",title:"Show/Hide Columns",cursor:"pointer"};jQuery("#"+b.jqgrid.id).jqGrid(jQuery.extend(b.jqgrid.options,
a)).jqGrid("navGrid","#"+b.jqgrid.pager.id,b.jqgrid.pager.options,{},{},{},{closeAfterSearch:true,multipleSearch:true},{}).jqGrid("navButtonAdd","#"+b.jqgrid.pager.id,e);jQuery("#"+b.jqgrid.id).jqGrid("filterToolbar",{});jQuery("#load_"+b.jqgrid.id).closest("div").css("line-height","100%");jQuery("#load_"+b.jqgrid.id).html("<img src='/soc/content/images/jqgrid_loading.gif'></img>");jQuery("#load_"+b.jqgrid.id).show();b.jqgrid.object=jQuery("#"+b.jqgrid.id)};this.getDiv=function(){return h};this.getIdx=
function(){return i};(function(){jQuery(function(){if(jQuery("#"+h).length===0)throw new w.error.divNotExistent("Div "+h+" is not existent");b.jqgrid.id="jqgrid_"+h;b.jqgrid.pager.id="jqgrid_pager_"+h;b.jqgrid.options=jQuery.extend(x,{pager:"#"+b.jqgrid.pager.id});b.jqgrid.pager.options=s;l.add(b);z();v();y()})})()}if(window.melange===undefined)throw new Error("Melange not loaded");var w=window.melange;if(window.jLinq===undefined)throw new Error("jLinq not loaded");var r=window.jLinq;w.list=window.melange.list=
function(){return new w.list};var D=w.logging.debugDecorator(w.list);w.error.createErrors(["listIndexNotValid","divNotExistent","indexAlreadyExistent"]);var A=function(h){for(var i in h)return false;return true},C=function(h){var i=h.my_index,p=l.get(i).data.data,n=p,b="",x={eq:{method:"equals",not:false},ne:{method:"equals",not:true},lt:{method:"less",not:false},le:{method:"lessEquals",not:false},gt:{method:"greater",not:false},ge:{method:"greaterEquals",not:false},bw:{method:"startsWith",not:false},
bn:{method:"startsWith",not:true},ew:{method:"endsWith",not:false},en:{method:"endsWith",not:true},cn:{method:"contains",not:false},nc:{method:"contains",not:true},"in":{method:"match",not:false},ni:{method:"match",not:true}};if(h._search&&h.filters){var s=JSON.parse(h.filters);if(s.rules[0].data!==""){b=s.groupOp;if(b==="OR")n={};jQuery.each(s.rules,function(e,d){if(d.op==="in"||d.op==="ni")d.data=d.data.split(",").join("|");n=x[d.op].not?b==="OR"?r.from(n).union(r.from(p).not()[x[d.op].method](d.field,
d.data).select()).select():r.from(n).not()[x[d.op].method](d.field,d.data).select():b==="OR"?r.from(n).union(r.from(p)[x[d.op].method](d.field,d.data).select()).select():r.from(n)[x[d.op].method](d.field,d.data).select()})}}else p[0]!==undefined&&jQuery.each(p[0],function(e){if(h[e]!==undefined){var d=jQuery("#regexp_"+l.get(i).jqgrid.id).is(":checked"),k=false;jQuery.each(l.get(i).configuration.colModel,function(g,f){if(f.editoptions!==undefined&&e===f.name)k=true});n=d||k?r.from(n).match(e,h[e]).select():
r.from(n).contains(e,h[e]).select()}});var u=h.sidx;s=h.sord;jQuery.each(l.get(i).configuration.colModel,function(e,d){if(d.name===u&&(d.sorttype==="integer"||d.sorttype==="int"))jQuery.each(n,function(k,g){k=parseInt(g[u],10);isNaN(k)||(g[u]=k)})});s=s==="asc"?"":"-";if(n.length>0)n=r.from(n).ignoreCase().orderBy(s+u).select();l.get(i).data.filtered_data=n;if(h.rows===-1)h.rows=l.get(i).data.filtered_data.length;s=(h.page-1)*h.rows;for(var z=h.page*h.rows-1,y={page:h.page,total:n.length===0?0:Math.ceil(n.length/
h.rows),records:n.length,rows:[]},v=s;v<=z;v++)if(n[v]!==undefined){var a=[];p[0]!==undefined&&jQuery.each(l.get(i).configuration.colModel,function(e,d){var k;e=l.get(i).data.all_data;for(var g=0;g<e.length;g++)if(e[g].columns.key===n[v].key){k=e[g];break}d=n[v][d.name];if(k.operations!==undefined&&k.operations.row!==undefined&&k.operations.row.link!==undefined)if(d!==null&&d!==undefined&&d.toString().match(/<a\b[^>]*>.*<\/a>/)===null)d='<a style="display:block;" href="'+k.operations.row.link+'" class="listsnoul">'+
d+"</a>";a.push(d)});y.rows.push({key:n[v].key,cell:a})}jQuery("#"+l.get(i).jqgrid.id)[0].addJSONData(y)},l=function(){var h=[];return{add:function(i){h[i.getIdx()]=i},get:function(i){return h[i]!==undefined?h[i]:null},getAll:function(){return jQuery.extend({},h)},isExistent:function(i){return h[i]!==undefined?true:false}}}();D.loadList=function(h,i,p){p=parseInt(p,10);i=JSON.parse(i);if(isNaN(p)||p<0)throw new w.error.listIndexNotValid("List index "+p+" is not valid");if(l.isExistent(p))throw new w.error.indexAlreadyExistent("Index "+
p+" is already existent");new B(h,p,i.configuration,i.operations)}})();<commit_msg>Commit minimized version of the list code<commit_after>(function(){function C(h,i,p,n){var b=this,x={datatype:D,viewrecords:true},t={edit:false,add:false,del:false,afterRefresh:function(){b.refreshData();b.jqgrid.object.trigger("reloadGrid")}};h=h;i=i;this.configuration=p;this.operations=n;this.jqgrid={id:null,object:null,options:null,last_selected_row:null,editable_columns:[],dirty_fields:{},pager:{id:null,options:null}};this.data={data:[],all_data:[],filtered_data:null};var u={enableDisableButtons:function(a){return function(f){function d(m){var c=
jQuery("#"+a.jqgrid.id).jqGrid("getRowData",m),e=s.from(a.data.all_data).equals("columns.key",c.key).select()[0];if(a.jqgrid.dirty_fields[c.key]===undefined)a.jqgrid.dirty_fields[c.key]=[];var r=[],q=[];jQuery.each(c,function(o,l){l!=e.columns[o]?r.push(o):q.push(o)});jQuery.each(r,function(o,l){jQuery.inArray(l,a.jqgrid.dirty_fields[c.key])===-1&&a.jqgrid.dirty_fields[c.key].push(l)});jQuery.each(q,function(o,l){o=jQuery.inArray(l,a.jqgrid.dirty_fields[c.key]);o!==-1&&a.jqgrid.dirty_fields[c.key].splice(o,
1)});a.jqgrid.dirty_fields[c.key].length===0&&delete a.jqgrid.dirty_fields[c.key];jQuery.each(a.operations.buttons,function(o,l){if(l.type==="post_edit"){o=jQuery("#"+a.jqgrid.id+"_buttonOp_"+l.id);B(a.jqgrid.dirty_fields)?o.attr("disabled","disabled"):o.removeAttr("disabled")}})}var j=a.jqgrid.object.jqGrid("getGridParam","multiselect")?"selarrrow":"selrow",g=a.jqgrid.object.jqGrid("getGridParam",j);if(!g instanceof Array)g=[g];if(g.length===1)if(f&&f!==a.jqgrid.last_selected_row){jQuery("#"+a.jqgrid.id).restoreRow(a.jqgrid.last_selected_row);
jQuery("#"+a.jqgrid.id).jqGrid("editRow",f,true,null,null,"clientArray",null,d);a.jqgrid.last_selected_row=f}jQuery.each(a.operations.buttons,function(m,c){m=jQuery("#"+a.jqgrid.id+"_buttonOp_"+c.id);if(c.type!=="post_edit")if(g.length>=c.real_bounds[0]&&g.length<=c.real_bounds[1]){m.removeAttr("disabled");if(c.real_bounds[0]===1&&c.real_bounds[1]===1&&m.data("melange")!==undefined){var e=a.jqgrid.object.jqGrid("getRowData",g[0]);e=s.from(a.data.all_data).equals("columns.key",e.key).select()[0];var r=
m.data("melange").click;m.click(r(e.operations.buttons[c.id].link));m.attr("value",e.operations.buttons[c.id].caption)}}else m.attr("disabled","disabled")})}}(b),global_button_functions:{redirect_simple:function(a){return a.new_window?function(){window.open(a.link)}:function(){window.location.href=a.link}},redirect_custom:function(a){return function(f){return a.new_window?function(){window.open(f)}:function(){window.location.href=f}}},post:function(a){return function(){var f=k.get(a.idx).jqgrid.object.jqGrid("getGridParam",
"multiselect")?"selarrrow":"selrow";f=k.get(a.idx).jqgrid.object.jqGrid("getGridParam",f);f instanceof Array||(f=f===null?[]:[f]);var d=[];if(!(f.length<a.real_bounds[0]||f.length>a.real_bounds[1])){jQuery.each(f,function(j,g){var m=jQuery("#"+k.get(a.idx).jqgrid.id).jqGrid("getRowData",g);s.from(k.get(a.idx).all_data).equals("columns.key",m.key).select();var c={};jQuery.each(a.keys,function(e,r){e=m[r];if(jQuery(e).hasClass("listsnoul"))e=/^<a\b[^>]*>(.*?)<\/a>$/.exec(e)[1];c[r]=e});d.push(c)});
if(a.url==="")a.url=window.location.href;jQuery.post(a.url,{xsrf_token:window.xsrf_token,idx:a.idx,button_id:a.button_id,data:JSON.stringify(d)},function(j){if(a.redirect=="true")try{var g=JSON.parse(j);if(g.data.url!==undefined)window.location.href=g.data.url}catch(m){}j=parseInt(a.refresh,10);if(!isNaN(j)){k.get(j).refreshData();jQuery("#"+k.get(j).jqgrid.id).trigger("reloadGrid")}if(a.refresh=="current"){k.get(a.idx).refreshData();jQuery("#"+k.get(a.idx).jqgrid.id).trigger("reloadGrid")}else if(a.refresh==
"all"){j=k.getAll();jQuery.each(j,function(c,e){e.refreshData();jQuery("#"+k.get(c).jqgrid.id).trigger("reloadGrid")})}})}}},post_edit:function(a){return function(){var f=k.get(a.idx).jqgrid,d={};if(!(f.editable_columns.length===0&&B(f.dirty_fields))){for(var j=f.object.jqGrid("getGridParam","records"),g=1;g<=j;g++){var m=jQuery("#"+f.id).jqGrid("getRowData",g);if(f.dirty_fields[m.key]!==undefined){d[m.key]={};jQuery.each(f.dirty_fields[m.key],function(c,e){d[m.key][e]=m[e]})}}if(a.url==="")a.url=
window.location.href;jQuery.post(a.url,{xsrf_token:window.xsrf_token,idx:a.idx,button_id:a.button_id,data:JSON.stringify(d)},function(c){if(a.redirect=="true")try{var e=JSON.parse(c);if(e.data.url!==undefined)window.location.href=e.data.url}catch(r){}c=parseInt(a.refresh,10);if(!isNaN(c)){k.get(c).refreshData();jQuery("#"+k.get(c).jqgrid.id).trigger("reloadGrid")}if(a.refresh=="current"){k.get(a.idx).refreshData();jQuery("#"+k.get(a.idx).jqgrid.id).trigger("reloadGrid")}else if(a.refresh=="all"){c=
k.getAll();jQuery.each(c,function(q,o){o.refreshData();jQuery("#"+k.get(q).jqgrid.id).trigger("reloadGrid")})}})}}}},row_functions:{redirect_custom:function(a){return function(f,d){return a.new_window||d.which===2||d.which===1&&d.ctrlKey?function(){window.open(f)}:function(){window.location.href=f}}}}},A=function(){jQuery("#"+h).replaceWith(['<p id="temporary_list_placeholder_',i,'"></p>','<table id="'+b.jqgrid.id+'"',' cellpadding="0" cellspacing="0"></table>','<div id="'+b.jqgrid.pager.id+'"',' style="text-align:center"></div>'].join(""))},
y=function(){var a="",f=0,d=function(){var j="?";if(window.location.href.indexOf("?")!==-1)j="&";jQuery.ajax({async:true,cache:false,url:[window.location.href,j,"fmt=json&limit=150",a===""?"":"&start="+a,"&idx=",i].join(""),timeout:6E4,tryCount:1,retryLimit:5,error:function(g){if(g.status==500){this.tryCount++;if(this.tryCount<=this.retryLimit)jQuery.ajax(this);else{jQuery("#temporary_list_placeholder_"+i).html('<span style="color:red">Error retrieving data: please refresh the list or the whole page to try again</span>');
jQuery("#load_"+b.jqgrid.id).hide()}}else{jQuery("#temporary_list_placeholder_"+i).html('<span style="color:red">Error retrieving data: please refresh the list or the whole page to try again</span>');jQuery("#load_"+b.jqgrid.id).hide()}},success:function(g){var m=g.next==="done";if(g.data[a]!==undefined){if(b.configuration===null)b.configuration=g.configuration;if(b.operations===null)b.operations=g.operations;jQuery.each(g.data[a],function(){b.data.data.push(this.columns);b.data.all_data.push(this)});
b.jqgrid.object===null?v():b.jqgrid.object.trigger("reloadGrid");if(m){a=g.next;setTimeout(d,100);f++}else{jQuery("#temporary_list_placeholder_"+i).remove();jQuery("#load_"+b.jqgrid.id).hide()}}if(m){jQuery("#temporary_list_placeholder_"+i).remove();jQuery("#load_"+b.jqgrid.id).hide();jQuery("#"+b.jqgrid.id)[0].triggerToolbar();jQuery.each(b.configuration.colModel,function(c,e){e.editable!==undefined&&e.editable===true&&b.jqgrid.editable_columns.push(e.name)});jQuery("#t_"+b.jqgrid.id).children().remove();
b.operations!==undefined&&b.operations.buttons!==undefined&&jQuery.each(b.operations.buttons,function(c,e){c=b.jqgrid.id+"_buttonOp_"+e.id;jQuery("#t_"+b.jqgrid.id).append("<input type='button' value='"+e.caption+"' style='float:left' id='"+c+"'/>");e.parameters.idx=i;if(e.type!=="post_edit"){e.real_bounds=e.bounds;var r=e.real_bounds.indexOf("all");if(r!==-1)e.real_bounds[r]=b.jqgrid.object.jqGrid("getGridParam","records");e.parameters.real_bounds=e.real_bounds}if(e.type==="post_edit"||e.real_bounds[0]>
0)jQuery("#"+c).attr("disabled","disabled");e.parameters.button_id=e.id;jQuery("#"+c).click(u.global_button_functions[e.type](e.parameters));e.type=="redirect_custom"&&jQuery("#"+c).data("melange",{click:u.global_button_functions[e.type](e.parameters)})});jQuery("#t_"+b.jqgrid.id).css("padding-bottom","3px");jQuery("#t_"+b.jqgrid.id).append("<input type='button' value='CSV Export' style='float:right;' id='csvexport_"+b.jqgrid.id+"'/>");jQuery("#csvexport_"+b.jqgrid.id).button();jQuery("#csvexport_"+
b.jqgrid.id).click(function(){var c=[];c[0]=[];if(b.data.data[0]!==undefined||b.data.filtered_data[0]!==undefined){var e=b.data.filtered_data||b.data.data;jQuery.each(b.configuration.colNames,function(q,o){q=o;q=q.replace(/\"|&quot;|&#34;/g,'""');if(q.indexOf(",")!==-1||q.indexOf('"')!==-1||q.indexOf("\r\n")!==-1)q='"'+q+'"';c[0].push(q)});c[0]=c[0].join(",");var r=[];jQuery.each(b.configuration.colModel,function(q,o){r.push(o.name)});jQuery.each(e,function(q,o){c[c.length]=[];jQuery.each(r,function(l,
z){l=o[z];if(l===null)l="";if(l===undefined)l="";l=l.toString();z=/^<a\b[^>]*href="(.*?)" \b[^>]*>(.*?)<\/a>$/.exec(l);if(z!==null)l=z[1];l=l.replace(/\"|&quot;|&#34;/g,'""');if(l.indexOf(",")!==-1||l.indexOf('"')!==-1||l.indexOf("\r\n")!==-1)l='"'+l+'"';c[c.length-1].push(l)});c[c.length-1]=c[c.length-1].join(",")});c=c.join("\r\n");jQuery("#csv_dialog").remove();jQuery("body").append(["<div id='csv_dialog' style='display:none'>  <h3>Now you can copy and paste CSV data from the text area to a new file:</h3>  <textarea style='width:450px;height:250px'>",
c,"</textarea></div>"].join(""));jQuery("#csv_dialog").dialog({height:420,width:500,modal:true,buttons:{Close:function(){jQuery(this).dialog("close")}}})}});jQuery("#t_"+b.jqgrid.id).append("<div style='float:right;margin-right:4px;'><input type='checkbox' id='regexp_"+b.jqgrid.id+"'/>RegExp Search</div>");jQuery("#regexp_"+b.jqgrid.id).click(function(){jQuery("#"+b.jqgrid.id).jqGrid().trigger("reloadGrid")});g=jQuery.Event("melange_list_loaded");g.list_object=b;b.jqgrid.object.trigger(g)}}})};setTimeout(d,
100)};this.refreshData=function(){b.data={data:[],all_data:[],filtered_data:null};y()};var v=function(){var a=jQuery.extend(b.configuration,{postData:{my_index:i},onSelectAll:u.enableDisableButtons,onSelectRow:u.enableDisableButtons}),f={caption:"",buttonicon:"ui-icon-calculator",onClickButton:function(){jQuery("#"+b.jqgrid.id).setColumns({colnameview:false,jqModal:true,ShrinkToFit:true});return false},position:"last",title:"Show/Hide Columns",cursor:"pointer"};jQuery("#"+b.jqgrid.id).jqGrid(jQuery.extend(b.jqgrid.options,
a)).jqGrid("navGrid","#"+b.jqgrid.pager.id,b.jqgrid.pager.options,{},{},{},{closeAfterSearch:true,multipleSearch:true},{}).jqGrid("navButtonAdd","#"+b.jqgrid.pager.id,f);jQuery("#"+b.jqgrid.id).jqGrid("filterToolbar",{});jQuery("#load_"+b.jqgrid.id).closest("div").css("line-height","100%");jQuery("#load_"+b.jqgrid.id).html("<img src='/soc/content/images/jqgrid_loading.gif'></img>");jQuery("#load_"+b.jqgrid.id).show();b.jqgrid.object=jQuery("#"+b.jqgrid.id)};this.getDiv=function(){return h};this.getIdx=
function(){return i};(function(){jQuery(function(){if(jQuery("#"+h).length===0)throw new w.error.divNotExistent("Div "+h+" is not existent");b.jqgrid.id="jqgrid_"+h;b.jqgrid.pager.id="jqgrid_pager_"+h;b.jqgrid.options=jQuery.extend(x,{pager:"#"+b.jqgrid.pager.id});b.jqgrid.pager.options=t;k.add(b);A();v();y()})})()}if(window.melange===undefined)throw new Error("Melange not loaded");var w=window.melange;if(window.jLinq===undefined)throw new Error("jLinq not loaded");var s=window.jLinq;w.list=window.melange.list=
function(){return new w.list};var E=w.logging.debugDecorator(w.list);w.error.createErrors(["listIndexNotValid","divNotExistent","indexAlreadyExistent"]);var B=function(h){for(var i in h)return false;return true},D=function(h){var i=h.my_index,p=k.get(i).data.data,n=p,b="",x={eq:{method:"equals",not:false},ne:{method:"equals",not:true},lt:{method:"less",not:false},le:{method:"lessEquals",not:false},gt:{method:"greater",not:false},ge:{method:"greaterEquals",not:false},bw:{method:"startsWith",not:false},
bn:{method:"startsWith",not:true},ew:{method:"endsWith",not:false},en:{method:"endsWith",not:true},cn:{method:"contains",not:false},nc:{method:"contains",not:true},"in":{method:"match",not:false},ni:{method:"match",not:true}};if(h._search&&h.filters){var t=JSON.parse(h.filters);if(t.rules[0].data!==""){b=t.groupOp;if(b==="OR")n={};jQuery.each(t.rules,function(f,d){if(d.op==="in"||d.op==="ni")d.data=d.data.split(",").join("|");n=x[d.op].not?b==="OR"?s.from(n).union(s.from(p).not()[x[d.op].method](d.field,
d.data).select()).select():s.from(n).not()[x[d.op].method](d.field,d.data).select():b==="OR"?s.from(n).union(s.from(p)[x[d.op].method](d.field,d.data).select()).select():s.from(n)[x[d.op].method](d.field,d.data).select()})}}else p[0]!==undefined&&jQuery.each(p[0],function(f){if(h[f]!==undefined){var d=jQuery("#regexp_"+k.get(i).jqgrid.id).is(":checked"),j=false;jQuery.each(k.get(i).configuration.colModel,function(g,m){if(m.editoptions!==undefined&&f===m.name)j=true});n=d||j?s.from(n).match(f,h[f]).select():
s.from(n).contains(f,h[f]).select()}});var u=h.sidx;t=h.sord;jQuery.each(k.get(i).configuration.colModel,function(f,d){if(d.name===u&&(d.sorttype==="integer"||d.sorttype==="int"))jQuery.each(n,function(j,g){j=parseInt(g[u],10);isNaN(j)||(g[u]=j)})});t=t==="asc"?"":"-";if(n.length>0)n=s.from(n).ignoreCase().orderBy(t+u).select();k.get(i).data.filtered_data=n;if(h.rows===-1)h.rows=k.get(i).data.filtered_data.length;t=(h.page-1)*h.rows;for(var A=h.page*h.rows-1,y={page:h.page,total:n.length===0?0:Math.ceil(n.length/
h.rows),records:n.length,rows:[]},v=t;v<=A;v++)if(n[v]!==undefined){var a=[];p[0]!==undefined&&jQuery.each(k.get(i).configuration.colModel,function(f,d){var j;f=k.get(i).data.all_data;for(var g=0;g<f.length;g++)if(f[g].columns.key===n[v].key){j=f[g];break}d=n[v][d.name];if(j.operations!==undefined&&j.operations.row!==undefined&&j.operations.row.link!==undefined)if(d!==null&&d!==undefined&&d.toString().match(/<a\b[^>]*>.*<\/a>/)===null)d='<a style="display:block;" href="'+j.operations.row.link+'" class="listsnoul">'+
d+"</a>";a.push(d)});y.rows.push({key:n[v].key,cell:a})}jQuery("#"+k.get(i).jqgrid.id)[0].addJSONData(y)},k=function(){var h=[];return{add:function(i){h[i.getIdx()]=i},get:function(i){return h[i]!==undefined?h[i]:null},getAll:function(){return jQuery.extend({},h)},isExistent:function(i){return h[i]!==undefined?true:false}}}();E.loadList=function(h,i,p){p=parseInt(p,10);i=JSON.parse(i);if(isNaN(p)||p<0)throw new w.error.listIndexNotValid("List index "+p+" is not valid");if(k.isExistent(p))throw new w.error.indexAlreadyExistent("Index "+
p+" is already existent");new C(h,p,i.configuration,i.operations)}})();
{'fraction_non_alphanumeric': 0.28841037284046966, 'fraction_numerical': 0.007520664088828976, 'mean_word_length': 13.651767151767151, 'pattern_counts': {'":': 12, '<': 79, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '395557', 'n_tokens_mistral': 11499, 'n_tokens_neox': 11195, 'n_words': 400}