Formatting.
This commit is contained in:
parent
072d179944
commit
42dec67764
4 changed files with 24 additions and 24 deletions
|
@ -17,14 +17,14 @@ var app=Application.currentApplication()
|
|||
app.includeStandardAdditions=true
|
||||
app.activate()
|
||||
var res=app.chooseColor({defaultColor:{{json .}}})
|
||||
{"rgb("+res.map(x=>Math.round(x*255))+")"}
|
||||
{'rgb('+res.map(x=>Math.round(x*255))+')'}
|
||||
{{- end}}
|
||||
{{define "dialog" -}}
|
||||
var app=Application.currentApplication()
|
||||
app.includeStandardAdditions=true
|
||||
app.activate()
|
||||
ObjC.import("stdlib")
|
||||
ObjC.import("stdio")
|
||||
ObjC.import('stdio')
|
||||
ObjC.import('stdlib')
|
||||
var res=app.{{.Operation}}({{json .Text}},{{json .Options}})
|
||||
if(res.gaveUp){$.exit(5)}
|
||||
if(res.buttonReturned==={{json .Extra}}){$.puts(res.buttonReturned)
|
||||
|
|
|
@ -3,4 +3,4 @@ app.includeStandardAdditions = true
|
|||
app.activate()
|
||||
|
||||
var res = app.chooseColor({defaultColor: {{json .}}})
|
||||
{"rgb(" + res.map(x => Math.round(x * 255)) + ")"}
|
||||
{'rgb(' + res.map(x => Math.round(x * 255)) + ')'}
|
|
@ -2,8 +2,8 @@ var app = Application.currentApplication()
|
|||
app.includeStandardAdditions = true
|
||||
app.activate()
|
||||
|
||||
ObjC.import("stdlib")
|
||||
ObjC.import("stdio")
|
||||
ObjC.import('stdio')
|
||||
ObjC.import('stdlib')
|
||||
|
||||
var res = app.{{.Operation}}({{json .Text}}, {{json .Options}})
|
||||
if (res.gaveUp) {
|
||||
|
|
|
@ -6,29 +6,29 @@ ObjC.import('stdlib')
|
|||
ObjC.import('readline')
|
||||
|
||||
{{- if .Total}}
|
||||
Progress.totalUnitCount = {{.Total}}
|
||||
Progress.totalUnitCount = {{.Total}}
|
||||
{{- end}}
|
||||
{{- if .Description}}
|
||||
Progress.description = {{json .Description}}
|
||||
Progress.description = {{json .Description}}
|
||||
{{- end}}
|
||||
|
||||
while (true) {
|
||||
var s
|
||||
try {
|
||||
s = $.readline('')
|
||||
} catch (e) {
|
||||
if (e.errorNumber === -128) $.exit(1)
|
||||
break
|
||||
}
|
||||
var s
|
||||
try {
|
||||
s = $.readline('')
|
||||
} catch (e) {
|
||||
if (e.errorNumber === -128) $.exit(1)
|
||||
break
|
||||
}
|
||||
|
||||
if (s.indexOf('#') === 0) {
|
||||
Progress.additionalDescription = s.slice(1)
|
||||
continue
|
||||
}
|
||||
if (s.indexOf('#') === 0) {
|
||||
Progress.additionalDescription = s.slice(1)
|
||||
continue
|
||||
}
|
||||
|
||||
var i = parseInt(s)
|
||||
if (i >= 0 && Progress.totalUnitCount > 0) {
|
||||
Progress.completedUnitCount = i
|
||||
continue
|
||||
}
|
||||
var i = parseInt(s)
|
||||
if (i >= 0 && Progress.totalUnitCount > 0) {
|
||||
Progress.completedUnitCount = i
|
||||
continue
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue