Created
June 28, 2012 11:05
-
-
Save caisui/3010704 to your computer and use it in GitHub Desktop.
指定サイズの矩形を MOW に 表示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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