{"size": 5218, "ext": "js", "max_stars_repo_path": "1.1/modules/Files.min.js", "max_stars_repo_name": "Berkmann18/Essencejs", "max_stars_repo_stars_event_min_datetime": "2017-01-09T00:38:26.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-29T10:24:44.000Z", "max_issues_repo_path": "1.1/modules/Files.min.js", "max_issues_repo_name": "Berkmann18/EssenceJS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "1.1/modules/Files.min.js", "max_forks_repo_name": "Berkmann18/EssenceJS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 179.9310344828, "max_line_length": 975, "alphanum_fraction": 0.7021847451}
//noinspection JSValidateJSDoc
//1. Get the file (if it exists) then get the content saved in an history accessible to the code.
//2. When the the code changes/updates the content, it's saved in the file (which is created if it didn't exist)
//noinspection JSUnusedGlobalSymbols
function stripPath(t){return t.split("/")[t.split("/").length-1]}function getFilename(t){return t?stripPath(location.pathname):stripPath(location.pathname).get(-stripPath(location.pathname).lastIndexOf(".")-1)}function getCurrentPath(t,e){e||(e="file:///")
for(var n,i=t.split("/"),r=e.split("/"),o=0,a=0;e.has(i[o]);)o++
for(n=i.get(o).join("/");n.has(r[a]);)debugging&&console.log("Gone through "+r[a]),a++
if(a>0)for(o=0;o<a;o++)n="../"+n
return n}function getExtPath(t){var e=location.href,n=e.sameFirst(t)
return"../".repeat(getCurrentPath(e,n).count("/"))+getCurrentPath(t,n)}function filenameList(t){for(var e=[],n=0;n<t.length;n++)e.push(stripPath(t[n]))
return e.remove()}function getDirectoryPath(t){return t||(t=location.href),t.get(0,t.indexOf(stripPath(t))-1)}function AX(t,e,n,i){var r=new ActiveXObject("Scripting.FileSystemObject")
r.CreateTextFile(t,!0)
var o=r.OpenTextFile(t,1,!0)
o.Write(e),o.ReadAll(),n&&confirm("Do you really want to close this file ?")&&o.Close(),i&&confirm("Do you really want to delete this file ?")&&r.DeleteFile(t)}function execFile(t,e){var n=new ActiveXObject("WScript.Shell")
n.Run(t+"."+e,1,!0)}function copyToClipboard(t,e){clipboardData.setData(e||"Text",t)}function save(t,e,n){var i=new Blob([t],{type:"text/"+(n||"plain")}),r=document.createElement("a")
r.download=e,r.innerHTML="Download File",null!=window.webkitURL?r.href=window.webkitURL.createObjectURL(i):(r.href=window.URL.createObjectURL(i),r.onclick=function(t){document.body.removeChild(t.target)},r.style.display="none",document.body.appendChild(r)),r.click()}function getFileContent(t){$G.fct=""
var e=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")
return e.open("GET",t,!1),e.onreadystatechange=function(){if(4===this.readyState&&200===this.status)return $G.fct=e.responseText,e.responseText},e.send(null),$G.fct}function getFC(t,e){!e&&t.has("://")&&t.split("//")[0]!=location.protocol&&(e=!0)
var n="",i=e?new CORS(t,"GET",!1,function(t){return n=t.responseText,t.responseText},function(){return"Nothing"}):new XHR(t,"GET",!1,function(t){return n=t.responseText,t.responseText},function(){return"Nothing"})
return i.init(),n}function evalFile(t,e){return new Function("return "+getFC(t,e))()}function getKeywords(t,e){var n=(isType(t,"Array")?t.join(" "):t).replace(/(\.|!|\?|;|:|"|,|\t|\n|\f|\r|\v|\{|})+/gm," ").split(" ").remove(),i=occurrenceSort(n).filter(function(t){return e?!["=","+","-","*","/","\\","%","#","'","@","^","$","£","µ","~","&","[","]","(",")","|","`"].has(t)&&n.count(t)>3:n.count(t)>3})
return i.map(function(t){return t+": "+n.count(t)+" ("+markConv(n.count(t),n.length)+"%)"})}function Spider(t){return this.dir=t||[],this.keywords=[],this.get=function(t,e){for(var n=0;n<this.dir.length;n++)this.keywords[n]=getKeywords(getFC(this.dir[n],e),!t)
return this.keywords},this.getAll=function(t,e){return this.get(t,e).linearise()},this.getWords=function(t,e){return this.getAll(t,e).map(function(t){return t.split(":")[0]})},this.getOccurrences=function(t,e){return this.getAll(t,e).map(function(t){return parseInt(t.split(" ")[1])})},this.getFreq=function(t,e){return this.getAll(t,e).map(function(t){return parseFloat(t.split(" ")[2].replace(/^\((\d+|\d+\.\d+)%\)$/,"$1"))})},this.getCoverage=function(t,e){return this.getFreq(t,e).sum().toNDec(2)},this.getGlobalKeywords=function(t,e){var n=this.dir.map(function(t){return getFC(t,e)}).toStr()
return getKeywords(n,!t)},this.toString=function(){return"Spider(dir="+this.dir+", keywords= "+this.keywords.toStr(!0)+")"},this}function $Data(t,e){this.name=t||"data.json",this.data=e
var n=this
return this.req=new CORS(this.name,"GET",!1,function(t){n.data=t.response},function(){Essence.say("The file %c"+n.name+"%c isn't available !","warn","text-decoration: italic;","text-decoration: none;")},function(){anim("Loading",0,5e3,500,!1,!isNon(n.req.data))},this.data),this.req.init(),this.req.update(),this.history=new virtualHistory(this.data),this.save=function(){save(this.data,this.name,this.data.split(".").last())},this.undo=function(){this.history.undo(),this.data=this.history.src},this.redo=function(){this.history.redo(),this.data=this.history.src},this.update=function(t){this.history.update(t||this.data),t&&(this.data=t),this.save()},this.get=function(){return this.req.init(),this.req.update(),this.data},this.toString=function(){return"$Data(name="+this.name+", data="+this.data+", history="+this.history.getStates()+", req="+this.req+")"},this}function loadDeferredStyle(t){var e=tryNode("noscript#deferredStyles","body"),n=document.createElement("div")
n.innerHTML=e.innerText,document.body.appendChild(n),e.delete()
var i=requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame
i?i(function(){wait(loadDeferredStyle)}):window.addEventListener("load",loadDeferredStyle)}var Files=new Module("Files","File management and control",["Ajax","Misc","DOM"])
