diff --git a/README.md b/README.md index 25ef796..4b3b507 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,20 @@ Ronin is my web based drawing tool it's under constant development. The repository comes with a script that fires Ronin from within Localhost. -Enjoy +## Example file + +``` +surface.resize 300x300 +layer.fill #AAAAAA +magnet.grid 15x15 4,4 +path:line_width 2 +path.stroke M60,60 A1,1 0 0,0 240,60 A1,1 0 0,0 240,240 +path.stroke M240,240 A1,1 0 0,0 60,240 A1,1 0 0,0 60,60 +``` + +## Load a preset + +Where `http://localhost:8022` will load the /presets/default.rin file, `http://localhost:8022/blank` will load /presets/blank.rin. ## TODOs General diff --git a/links/main.css b/links/main.css index 4ec0c5c..fca7604 100644 --- a/links/main.css +++ b/links/main.css @@ -32,7 +32,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #terminal #widget li.inactive { color:#fff; } #terminal #widget li.managed { color:#777; } -#terminal hint { display: block;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px;} +#terminal hint { display: none;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px;white-space: pre;} #terminal hint line { display: inline; width:calc(100% - 30px); } #terminal hint line .input { opacity:1; } #terminal hint line .status { position: absolute;right:30px; } diff --git a/presets/blank.rin b/presets/blank.rin index ec4ccd6..d3fa310 100644 --- a/presets/blank.rin +++ b/presets/blank.rin @@ -1,4 +1,4 @@ -~ Blank Setup +~ Setup frame.resize 400x400 layer.fill #A1A1A1 diff --git a/presets/default.rin b/presets/default.rin index f2c79d6..15eb23b 100644 --- a/presets/default.rin +++ b/presets/default.rin @@ -1,4 +1,4 @@ -~ Default +~ Setup frame.resize 300x300 frame.select main diff --git a/presets/grid.rune.rin b/presets/grid.rune.rin index ed93209..47cac01 100644 --- a/presets/grid.rune.rin +++ b/presets/grid.rune.rin @@ -1,6 +1,8 @@ -frame.resize 240x360 ; -frame.select background ; -layer.fill #A1A1A1 ; -brush:color #ff0000 ; -magnet.grid 15x15 4,4 ; -frame.select main ; \ No newline at end of file +~ Setup + +frame.resize 240x360 +layer.fill #A1A1A1 +magnet.grid 15x15 4,4 + +~ Stroke + diff --git a/scripts/core/init.js b/scripts/core/init.js index e8ded9a..2ffd1b0 100644 --- a/scripts/core/init.js +++ b/scripts/core/init.js @@ -31,6 +31,9 @@ starting_canvas.height = window.innerHeight - 300; starting_canvas.width = parseInt(starting_canvas.width/40) * 40; starting_canvas.height = parseInt(starting_canvas.height/40) * 40; -// ronin.terminal.load("default.rin"); -ronin.terminal.load("blank.rin"); + +var target_file = window.location.hash ? window.location.hash : "default"; +target_file = target_file.substr(1,target_file.length-1); + +ronin.terminal.load(window.location.hash ? target_file+".rin" : "default.rin"); ronin.widget.update(); diff --git a/scripts/modules/terminal.js b/scripts/modules/terminal.js index 0a37127..91b952d 100644 --- a/scripts/modules/terminal.js +++ b/scripts/modules/terminal.js @@ -63,7 +63,7 @@ function Terminal(rune) this.hint_element.innerHTML = ""; var queue = ronin.terminal.textarea.value.split("\n") for(id in queue){ - this.hint_element.innerHTML += ""+this.syntax_highlight(queue[id])+""+this.run_line(queue.length - id,queue[id])+"
"; + this.hint_element.innerHTML += ""+this.syntax_highlight(queue[id])+""+this.run_line(queue.length - id,queue[id])+"\n"; } } @@ -120,8 +120,6 @@ function Terminal(rune) { var line = line; - console.log(line[0]) - // Comment if(line[0] == "~"){ line = ""+line+""; } @@ -177,8 +175,11 @@ function Terminal(rune) } + 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); @@ -194,6 +195,7 @@ function Terminal(rune) } } rawFile.send(null); + ronin.widget.update(); } this.cmd = function() diff --git a/scripts/modules/terminal.widget.js b/scripts/modules/terminal.widget.js index a3a59b2..313c781 100644 --- a/scripts/modules/terminal.widget.js +++ b/scripts/modules/terminal.widget.js @@ -13,12 +13,9 @@ function Widget(rune) this.update = function() { var s = ""; - - s += ronin.cursor.widget(); - // for (var key in ronin.modules){ - // s += ronin.modules[key].widget() ? ""+key+""+ronin.modules[key].widget()+" " : ""; - // } - + s += ronin.terminal.file_name+" "; + s += "Cursor: "+ronin.cursor.widget(); + this.element.innerHTML = s; }