Improved design

This commit is contained in:
Devine Lu Linvega
2017-01-16 21:01:27 -07:00
parent 215cbfdd29
commit 8b963e6283
14 changed files with 54 additions and 27 deletions

View File

@@ -3,19 +3,20 @@ function FileSave(rune)
Module.call(this,rune);
this.parameters = [Any];
this.variables = {"format" : "png"};
this.active = function(cmd)
{
var n = "Ronin Export";
var f = cmd.variable("format");
var d = ronin.surface.active_layer.element.toDataURL('image/png');
// // ronin.surface.layers["render"].clear();
var d = null;
if(cmd.variable("format").value == "jpg"){
var d = ronin.surface.active_layer.element.toDataURL('image/jpeg');
}
else{
var d = ronin.surface.active_layer.element.toDataURL('image/png');
}
var w = window.open('about:blank','image from canvas');
// w.document.write("hello")
w.document.write("<title>"+(n ? n : "Untitled")+"</title><body><img src='"+d+"' width='"+ronin.surface.size.width+"px' height='"+ronin.surface.size.height+"px'/></body>");
}
this.passive = function(cmd)
{
w.document.write("<title>Untitled</title><body><img src='"+d+"' width='"+ronin.surface.size.width+"px' height='"+ronin.surface.size.height+"px'/></body>");
}
}

View File

@@ -7,6 +7,11 @@ function Module(rune)
this.docs = "Missing documentation.";
this.install = function()
{
console.log(this.rune);
}
this.active = function(cmd)
{
console.log("Nothing to do.");

View File

@@ -27,6 +27,7 @@ function Surface(rune)
}
if(cmd.bang() && Object.keys(ronin.surface.layers).length > 1){
// Remove element from DOM
delete this.layers[this.active_layer.name];
this.select_any_layer();
ronin.widget.update();

View File

@@ -44,7 +44,7 @@ function Layer(name,host = "user")
this.widget = function()
{
return (ronin.surface.active_layer.name == this.name) ? "<span class='highlight'>- ("+this.name+")</span><br />" : "- "+this.name+"<br />";
return (ronin.surface.active_layer.name == this.name) ? "<span class='highlight'>- "+this.name+"</span><br />" : "- "+this.name+"<br />";
}
this.move_from = null;