From f56180f7d297c08b8897d475e2043c0fdfca4e34 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 21 May 2017 18:46:48 -1000 Subject: [PATCH] Fixed export --- links/main.css | 4 ++++ presets/default.rin | 2 +- scripts/modules/frame.js | 2 +- scripts/modules/source.js | 29 ++++++++++++++++++++++++----- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/links/main.css b/links/main.css index 67fef5e..ed02908 100644 --- a/links/main.css +++ b/links/main.css @@ -24,3 +24,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #terminal #hint .method { display: inline-block; color:#999; } #terminal #hint .params { display: inline-block; color:#999; font-style: italic } #terminal #hint .setting { display: inline-block; color:#fff; font-style: italic } + +#modal { position: fixed; bottom:80px; right:20px; width:100px; height:100px; background:#111; border-radius:3px; overflow:hidden; display: block} +#modal.image img { display: block; max-width: 100%} +#modal.hidden { display: none } \ No newline at end of file diff --git a/presets/default.rin b/presets/default.rin index 932f70b..1bfb10b 100644 --- a/presets/default.rin +++ b/presets/default.rin @@ -10,6 +10,6 @@ type:color white type.write 38,262 "RONIN" type.write 38,252 "B08" brush:color #000000 -brush:size 10 +brush:size 4 path:line_width 20 path:line_color #999999 \ No newline at end of file diff --git a/scripts/modules/frame.js b/scripts/modules/frame.js index fa3bffd..6b50ef3 100644 --- a/scripts/modules/frame.js +++ b/scripts/modules/frame.js @@ -85,7 +85,7 @@ function Frame(rune) Object.keys(ronin.frame.layers).forEach(function (key) { ronin.frame.layers[key].blink(); }); - setTimeout(function(){ ronin.frame.blink(); }, 300); + setTimeout(function(){ ronin.frame.blink(); }, 30); } this.select_layer = function(layer) diff --git a/scripts/modules/source.js b/scripts/modules/source.js index 9a58818..6f0e1a3 100644 --- a/scripts/modules/source.js +++ b/scripts/modules/source.js @@ -2,11 +2,21 @@ function Source(rune) { Module.call(this,rune); - this.settings = {"format":"jpg","quality":"1"}; + this.modal_element = null; + + this.settings = {"format":"png","quality":"1"}; this.add_method(new Method("save",["name","rect","format"])); this.add_method(new Method("load",["path","position","rect"]),"Add point"); - + + this.install = function() + { + this.modal_element = document.createElement("modal"); + this.modal_element.id = "modal"; + this.modal_element.setAttribute("class","hidden"); + ronin.element.appendChild(this.modal_element); + } + this.load = function(params,preview = false) // source.load /01.jpg 0,0 100x100 { if(!params.filepath()){ return 0, "Path?"; } @@ -50,13 +60,13 @@ function Source(rune) var d = null; - ronin.terminal.query("terminal.display mini"); + this.modal(); if(this.settings["format"] == "jpg"){ - ronin.terminal.log(new Log(this,"","image")); + this.modal("image",""); } else{ - ronin.terminal.log(new Log(this,"","image")); + this.modal("image",""); } /* if(params.setting("format") && params.setting("format").value == "svg"){ @@ -74,6 +84,12 @@ function Source(rune) this.layer.remove(this); } + this.modal = function(type,content) + { + this.modal_element.setAttribute("class",type); + this.modal_element.innerHTML = content; + } + this.merge = function() { var a = []; @@ -93,5 +109,8 @@ function Source(rune) this.coordinates = []; this.last_pos = null; ronin.terminal.input.value = ""; + + this.modal_element.innerHTML = ""; + this.modal_element.setAttribute("class","hidden"); } } \ No newline at end of file