Formatting.

This commit is contained in:
Nuno Cruces 2022-03-27 00:05:52 +00:00
parent 072d179944
commit 42dec67764
4 changed files with 24 additions and 24 deletions

View file

@ -17,14 +17,14 @@ var app=Application.currentApplication()
app.includeStandardAdditions=true app.includeStandardAdditions=true
app.activate() app.activate()
var res=app.chooseColor({defaultColor:{{json .}}}) var res=app.chooseColor({defaultColor:{{json .}}})
{"rgb("+res.map(x=>Math.round(x*255))+")"} {'rgb('+res.map(x=>Math.round(x*255))+')'}
{{- end}} {{- end}}
{{define "dialog" -}} {{define "dialog" -}}
var app=Application.currentApplication() var app=Application.currentApplication()
app.includeStandardAdditions=true app.includeStandardAdditions=true
app.activate() app.activate()
ObjC.import("stdlib") ObjC.import('stdio')
ObjC.import("stdio") ObjC.import('stdlib')
var res=app.{{.Operation}}({{json .Text}},{{json .Options}}) var res=app.{{.Operation}}({{json .Text}},{{json .Options}})
if(res.gaveUp){$.exit(5)} if(res.gaveUp){$.exit(5)}
if(res.buttonReturned==={{json .Extra}}){$.puts(res.buttonReturned) if(res.buttonReturned==={{json .Extra}}){$.puts(res.buttonReturned)

View file

@ -3,4 +3,4 @@ app.includeStandardAdditions = true
app.activate() app.activate()
var res = app.chooseColor({defaultColor: {{json .}}}) var res = app.chooseColor({defaultColor: {{json .}}})
{"rgb(" + res.map(x => Math.round(x * 255)) + ")"} {'rgb(' + res.map(x => Math.round(x * 255)) + ')'}

View file

@ -2,8 +2,8 @@ var app = Application.currentApplication()
app.includeStandardAdditions = true app.includeStandardAdditions = true
app.activate() app.activate()
ObjC.import("stdlib") ObjC.import('stdio')
ObjC.import("stdio") ObjC.import('stdlib')
var res = app.{{.Operation}}({{json .Text}}, {{json .Options}}) var res = app.{{.Operation}}({{json .Text}}, {{json .Options}})
if (res.gaveUp) { if (res.gaveUp) {