Skip to content

Instantly share code, notes, and snippets.

@caisui
Created June 28, 2012 11:05
Show Gist options
  • Save caisui/3010704 to your computer and use it in GitHub Desktop.
Save caisui/3010704 to your computer and use it in GitHub Desktop.
指定サイズの矩形を MOW に 表示
commands.addUserCommand(["realsize"], "may be real size", function (args) {
var width, height;
if (args.length === 1)
width = height = args[0];
else {
width = args[0];
height = args[1];
}
if (args["-r"])
[width, height] = [height, width];
var style = <>
border:1px solid gray;
background-color: rgba(128,128,129,.8);
margin: 0 auto;
width:{width};
height:{height};
</>.toString();
commandline.close();
liberator.echo(<div style={style}></div>);
}, {
options: [
[["-r"], commands.OPTION_NOARG],
],
argCount: "+",
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment