Load .rin is back
This commit is contained in:
@@ -24,6 +24,4 @@ ronin.install();
|
||||
var target_file = window.location.hash ? window.location.hash : "default";
|
||||
target_file = target_file.substr(1,target_file.length-1);
|
||||
|
||||
ronin.start();
|
||||
|
||||
// ronin.terminal.load(window.location.hash ? target_file+".rin" : "default.rin");
|
||||
ronin.start(window.location.hash ? target_file+".rin" : "default.rin");
|
||||
@@ -47,11 +47,12 @@ function Ronin()
|
||||
this.widget.install();
|
||||
}
|
||||
|
||||
this.start = function()
|
||||
this.start = function(target_file)
|
||||
{
|
||||
ronin.terminal.update();
|
||||
ronin.widget.update();
|
||||
ronin.terminal.input.focus();
|
||||
ronin.load(target_file);
|
||||
}
|
||||
|
||||
this.cursors = [];
|
||||
@@ -81,4 +82,27 @@ function Ronin()
|
||||
this.on_resize = function()
|
||||
{
|
||||
}
|
||||
|
||||
this.filename = "default.rin";
|
||||
|
||||
this.load = function readTextFile(name)
|
||||
{
|
||||
this.filename = name;
|
||||
var file = "presets/"+name+'?'+new Date().getTime();
|
||||
var rawFile = new XMLHttpRequest();
|
||||
rawFile.open("GET", file, false);
|
||||
rawFile.onreadystatechange = function ()
|
||||
{
|
||||
if(rawFile.readyState === 4)
|
||||
{
|
||||
if(rawFile.status === 200 || rawFile.status == 0)
|
||||
{
|
||||
var allText = rawFile.responseText;
|
||||
ronin.terminal.run_multi(allText.split("\n").join(";"));
|
||||
}
|
||||
}
|
||||
}
|
||||
rawFile.send(null);
|
||||
ronin.widget.update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user