Getting back to normality
This commit is contained in:
@@ -2,6 +2,7 @@ function Method(name,params,mouse_event)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.host = null;
|
||||
this.name = name;
|
||||
this.params = params;
|
||||
this.mouse_event = mouse_event;
|
||||
@@ -17,4 +18,25 @@ function Method(name,params,mouse_event)
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
this.help = function()
|
||||
{
|
||||
var s = "";
|
||||
for(id in this.params){
|
||||
s += this.params[id]+":"
|
||||
}
|
||||
s = s.substr(0,s.length-1);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
this.preview = function(cmd)
|
||||
{
|
||||
return this.host[this.name](cmd,true);
|
||||
}
|
||||
|
||||
this.run = function(cmd)
|
||||
{
|
||||
return this.host[this.name](cmd,false);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,13 @@ function Rect(rect_str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "200x300";
|
||||
this.rect_str = rect_str;
|
||||
|
||||
this.width = rect_str ? parseFloat(this.rect_str.split("x")[0]) : 0;
|
||||
this.height = rect_str ? parseFloat(this.rect_str.split("x")[1]) : 0;
|
||||
|
||||
this.example = "200x300";
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return (isNaN(this.width) ? 0 : this.width)+"x"+(isNaN(this.height) ? 0 : this.height);
|
||||
|
||||
Reference in New Issue
Block a user