{"size": 1296, "ext": "js", "max_stars_repo_path": "assets/sortable.min.js", "max_stars_repo_name": "sjaakp/yii2-sortable-behavior", "max_stars_repo_stars_event_min_datetime": "2015-03-26T13:53:05.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-24T01:14:20.000Z", "max_issues_repo_path": "assets/sortable.min.js", "max_issues_repo_name": "sjaakp/yii2-sortable-behavior", "max_issues_repo_issues_event_min_datetime": "2015-05-04T08:44:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-17T15:20:15.000Z", "max_forks_repo_path": "assets/sortable.min.js", "max_forks_repo_name": "sjaakp/yii2-sortable-behavior", "max_forks_repo_forks_event_min_datetime": "2015-02-09T20:54:24.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-23T13:44:41.000Z"}
{"max_stars_count": 33, "max_issues_count": 9, "max_forks_count": 18, "avg_line_length": 1296.0, "max_line_length": 1296, "alphanum_fraction": 0.7260802469}
function sortable(o,e,l){document.querySelectorAll(e).forEach(a=>{let t=document.createElement(l);if(l==="tr"){let e=document.createElement("td");e.setAttribute("colspan",100);t.appendChild(e)}a.appendChild(t);t.classList.add("d-dummy");a.addEventListener("dragstart",e=>{e.dataTransfer.effectAllowed="move";let r=e.target;if(r.tagName.toLowerCase()==l){r.classList.add("d-dragged");let t=r.nextElementSibling;[...a.children].forEach(e=>{e.classList.remove("d-dropped");if(e!=r&&e!=t){e.classList.add("d-drop");e.ondragenter=e=>{e.preventDefault();e.target.closest(l).classList.add("d-over")};e.ondragleave=e=>{e.preventDefault();e.target.closest(l).classList.remove("d-over")};e.ondragover=e=>{e.preventDefault()};e.ondrop=e=>{e.preventDefault();r.classList.add("d-dropped");a.insertBefore(r,e.target.closest(l));let t=[...a.children].indexOf(r);let d=r.dataset.key;fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-CSRF-Token":document.querySelector('[name="csrf-token"]').content},body:`key=${d}&pos=${t}`})}}})}});a.addEventListener("dragend",e=>{[...a.getElementsByTagName(l)].forEach(e=>{e.classList.remove("d-drop");e.classList.remove("d-over");e.classList.remove("d-dragged");e.ondragenter=null;e.ondragleave=null;e.ondragover=null;e.ondrop=null})})})}