mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 08:48:06 +08:00
mac add check_argument
This commit is contained in:
parent
ed98ff1795
commit
2465289666
2
Makefile
2
Makefile
@ -21,7 +21,7 @@ build:
|
|||||||
go build $(BENCH)
|
go build $(BENCH)
|
||||||
|
|
||||||
run:
|
run:
|
||||||
etc/run.sh
|
etc/run.sh 2>var/error.log
|
||||||
|
|
||||||
win64:
|
win64:
|
||||||
GOARCH=amd64 GOOS=windows go build $(BENCH)
|
GOARCH=amd64 GOOS=windows go build $(BENCH)
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
"加载插件"{{{
|
"加载插件"{{{
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'vim-scripts/tComment'
|
Plug 'vim-scripts/tComment'
|
||||||
|
Plug 'gcmt/taboo.vim'
|
||||||
|
Plug 'vim-scripts/tComment'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
@ -15,9 +17,6 @@ Plug 'vim-airline/vim-airline-themes'
|
|||||||
Plug 'ntpeters/vim-better-whitespace'
|
Plug 'ntpeters/vim-better-whitespace'
|
||||||
Plug 'easymotion/vim-easymotion'
|
Plug 'easymotion/vim-easymotion'
|
||||||
|
|
||||||
Plug 'gcmt/taboo.vim'
|
|
||||||
set sessionoptions+=tabpages,globals
|
|
||||||
|
|
||||||
Plug 'vim-scripts/taglist.vim'
|
Plug 'vim-scripts/taglist.vim'
|
||||||
let g:Tlist_WinWidth=45
|
let g:Tlist_WinWidth=45
|
||||||
let g:Tlist_Exit_OnlyWindow=1
|
let g:Tlist_Exit_OnlyWindow=1
|
||||||
|
@ -131,6 +131,8 @@ func dir(m *ctx.Message, name string, level int, deep bool, fields []string) {
|
|||||||
case "filename":
|
case "filename":
|
||||||
m.Add("append", "filename", filename)
|
m.Add("append", "filename", filename)
|
||||||
case "is_dir":
|
case "is_dir":
|
||||||
|
f, e := os.Stat(filename)
|
||||||
|
m.Assert(e)
|
||||||
m.Add("append", "is_dir", f.IsDir())
|
m.Add("append", "is_dir", f.IsDir())
|
||||||
case "size":
|
case "size":
|
||||||
m.Add("append", "size", f.Size())
|
m.Add("append", "size", f.Size())
|
||||||
|
@ -63,14 +63,27 @@ function send_command(form, cb) {
|
|||||||
typeof(cb) == "function" && cb(msg)
|
typeof(cb) == "function" && cb(msg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
function check_argument(form, target) {
|
||||||
|
for (var i = 0; i < form.length-1; i++) {
|
||||||
|
if (form[i] == target) {
|
||||||
|
if (form[i+1].type == "button") {
|
||||||
|
form[i+1].click()
|
||||||
|
} else {
|
||||||
|
form[i+1].focus()
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
send_command(form)
|
||||||
|
}
|
||||||
function onaction(event, action) {
|
function onaction(event, action) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "click":
|
case "click":
|
||||||
if (event.target.nodeName == "INPUT") {
|
if (event.target.nodeName == "INPUT") {
|
||||||
if (event.altKey) {
|
if (event.altKey) {
|
||||||
console.log("fuck")
|
|
||||||
var board = document.querySelector("#clipboard")
|
var board = document.querySelector("#clipboard")
|
||||||
event.target.value = board.value
|
event.target.value = board.value
|
||||||
|
check_argument(event.target.form, event.target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@ -80,13 +93,7 @@ function onaction(event, action) {
|
|||||||
case "input":
|
case "input":
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
case "Enter":
|
case "Enter":
|
||||||
var form = event.target.form
|
check_argument(event.target.form, event.target)
|
||||||
for (var i = 0; i < form.length; i++) {
|
|
||||||
if (form[i] == event.target) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
(i == form.length-1)? send_command(form): form[i+1].focus()
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
case "Escape":
|
case "Escape":
|
||||||
event.target.value = ""
|
event.target.value = ""
|
||||||
|
@ -97,13 +97,14 @@
|
|||||||
{{if eq $form_type "upload"}}
|
{{if eq $form_type "upload"}}
|
||||||
method="POST" action="/upload" enctype="multipart/form-data"
|
method="POST" action="/upload" enctype="multipart/form-data"
|
||||||
{{end}}
|
{{end}}
|
||||||
|
onsubmit="onaction(event,'submit')"
|
||||||
>
|
>
|
||||||
<input style="display:none"></input>
|
<input style="display:none"></input>
|
||||||
{{range $index, $input := option . "inputs"}}
|
{{range $index, $input := option . "inputs"}}
|
||||||
<div>
|
<div>
|
||||||
{{$type := index $input "type"}}
|
{{$type := index $input "type"}}
|
||||||
{{if eq $type "button"}}
|
{{if eq $type "button"}}
|
||||||
<input type="button" name="{{index $input "name"}}" value="{{index $input "value"}}" onclick="return onaction(event, 'command')">
|
<button onclick="return onaction(event, 'command')">{{index $input "value"}}</button>
|
||||||
{{else if eq $type "submit"}}
|
{{else if eq $type "submit"}}
|
||||||
<input type="submit" value="{{index $input "value"}}">
|
<input type="submit" value="{{index $input "value"}}">
|
||||||
{{else if eq $type "file"}}
|
{{else if eq $type "file"}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user