diff --git a/links/main.css b/links/main.css index 7aba4cb..1349fb4 100644 --- a/links/main.css +++ b/links/main.css @@ -8,7 +8,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #overlay { position:absolute; z-index:1000;} #frame { cursor:none;} -#terminal { position: fixed;bottom: 0px;left: 0px;background: #000;width: 100vw;height: 30px;overflow: hidden;} +#terminal { position: fixed;bottom: 0px;left: 0px;background: #eee;width: 100vw;height: 30px;overflow: hidden; } #terminal logs { display: none;position: absolute;bottom:20px;width:100vw;color:white} #terminal logs log { display: block; font-size:10px; line-height:25px; padding:0px 5px; color:#666;} #terminal logs log .rune { color:white; } @@ -23,22 +23,6 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #terminal.mini { height:120px; } #terminal.full { height:100vh; } -#terminal #widget { position: absolute;top: 0px;right: 0px;line-height: 30px;font-size: 12px;z-index: 9000;color: white;width: calc(40vw - 15px);height: 100px;padding-left:30px } -#terminal #widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; min-width:100px;} -#terminal #widget span name { display: block; border-bottom: 1px solid #333; line-height:25px; margin-bottom:5px;} -#terminal #widget li { display:block; } -#terminal #widget li.active { color:#72dec2; } -#terminal #widget li.inactive { color:#fff; } -#terminal #widget li.managed { color:#777; } - -#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; } -#terminal hint line .input .module { background: #222; } -#terminal hint line .input .method { background: #333; } -#terminal hint line .input .setting { background: #444; } -#terminal hint line .input .comment { background: #222;width:100%;display: inline-block } - -#terminal input { line-height: 30px; width:400px; background:none; color:pink; font-size:12px; } - +#terminal input { position:fixed; bottom:0px; z-index:900; line-height: 20px; width:calc(100vw - 20px); background:none; color:black; font-size:11px; padding:5px 10px;} +#terminal hint { display: block;position: fixed;bottom: 0px;line-height: 20px; width:calc(100vw - 20px); background:none; color:#999; font-size:11px; padding:5px 10px; white-space: pre; } +#terminal #widget { display: block;position: fixed;bottom: 0px;line-height: 20px; width:calc(100vw - 20px); background:none; color:#999; font-size:11px; padding:5px 10px; white-space: pre; text-align: right} \ No newline at end of file diff --git a/scripts/core/init.js b/scripts/core/init.js index 3d7a221..40ff0db 100644 --- a/scripts/core/init.js +++ b/scripts/core/init.js @@ -21,17 +21,6 @@ document.onkeydown = function myFunction(){ keyboard.listen_onkeydown(event); }; ronin.install(); -// Canvas -var starting_canvas = new Rect(); -starting_canvas.width = window.innerWidth - 200; -starting_canvas.height = window.innerHeight - 300; - -// Clamp - -starting_canvas.width = parseInt(starting_canvas.width/40) * 40; -starting_canvas.height = parseInt(starting_canvas.height/40) * 40; - - var target_file = window.location.hash ? window.location.hash : "default"; target_file = target_file.substr(1,target_file.length-1); diff --git a/scripts/modules/frame.js b/scripts/modules/frame.js index 2564f74..d1d76c5 100644 --- a/scripts/modules/frame.js +++ b/scripts/modules/frame.js @@ -18,7 +18,17 @@ function Frame(rune) this.blink(); this.select(new Command(["background"])); - this.resize(new Command(["300x300"])); + // Canvas + var starting_canvas = new Rect(); + starting_canvas.width = window.innerWidth - 100; + starting_canvas.height = window.innerHeight - 100; + + // Clamp + + starting_canvas.width = parseInt(starting_canvas.width/40) * 40; + starting_canvas.height = parseInt(starting_canvas.height/40) * 40; + + this.resize(new Command([starting_canvas.width+"x"+starting_canvas.height])); } // Methods @@ -38,6 +48,9 @@ function Frame(rune) ronin.frame.element.style.width = this.settings["size"].width+"px"; ronin.frame.element.style.height = this.settings["size"].height+"px"; + ronin.frame.element.style.left = (window.innerWidth - this.settings["size"].width)/2; + ronin.frame.element.style.top = (window.innerHeight - this.settings["size"].height)/2; + ronin.on_resize(); return 1, "ok"; diff --git a/scripts/modules/terminal.js b/scripts/modules/terminal.js index adebd4a..dd36436 100644 --- a/scripts/modules/terminal.js +++ b/scripts/modules/terminal.js @@ -6,7 +6,6 @@ function Terminal(rune) this.input = document.createElement("input"); this.hint_element = document.createElement("hint"); this.logs_element = document.createElement("logs"); - this.status_element = document.createElement("status"); this.history = []; this.locks = []; @@ -20,24 +19,19 @@ function Terminal(rune) this.element.appendChild(this.input); this.element.appendChild(this.hint_element); this.element.appendChild(this.logs_element); - this.element.appendChild(this.status_element); - - this.status_element.innerHTML = "Ready."; + this.input.value = "" this.hint_element.innerHTML = ""; } this.run = function() { - this.run_line(this.input.value); - // this.hint_element.innerHTML = ""; - // var queue = ronin.terminal.input.value.split("\n") - // for(id in queue){ - // this.hint_element.innerHTML += ""+this.syntax_highlight(queue[id])+""+this.run_line(queue.length - id,queue[id])+"\n"; - // } + this.hint_element.innerHTML = ""; + this.run_line(this.input.value,false); + this.input.value = ""; } - this.run_line = function(line) + this.run_line = function(line,is_preview) { var content = line; @@ -63,7 +57,7 @@ function Terminal(rune) ronin.cursor.set_mode(ronin[module_name]); if(ronin[module_name] && ronin[module_name][method_name]){ - return ronin[module_name][method_name](parameters); + return ronin[module_name][method_name](parameters,is_preview); } else if(ronin[module_name] && ronin[module_name].settings[setting_name]){ return ronin[module_name].update_setting(setting_name,parameters); @@ -86,15 +80,6 @@ function Terminal(rune) return 0, "Unknown"; } - this.update_active_line = function(new_line) - { - var lines = this.input.value.split("\n"); - - lines[lines.length-1] = new_line; - - this.input.value = lines.join("\n"); - } - this.log = function(log) { @@ -102,7 +87,7 @@ function Terminal(rune) this.update = function() { - + this.hint_element.innerHTML = ""+this.input.value+" "+this.run_line(this.input.value,true); } this.filename = "default.rin"; diff --git a/scripts/modules/terminal.widget.js b/scripts/modules/terminal.widget.js index 313c781..0d1ad73 100644 --- a/scripts/modules/terminal.widget.js +++ b/scripts/modules/terminal.widget.js @@ -12,22 +12,9 @@ function Widget(rune) this.update = function() { - var s = ""; - s += ronin.terminal.file_name+" "; - s += "Cursor: "+ronin.cursor.widget(); - - this.element.innerHTML = s; + this.element.innerHTML = ronin.cursor.widget(); } - // this.widget = function() - // { - // if(!this.active_layer){ return ""; } - - // return this.rune+" "+this.settings["size"].render(); - // } - - // // Widget - this.update_widget = function() { if(!this.active_layer){ return; }