Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
1024程序员开源挑战赛
提交
d25ae5f6
1
1024程序员开源挑战赛
项目概览
夜猫逐梦
/
1024程序员开源挑战赛
与 Fork 源项目一致
Fork自
GitCode / 1024程序员开源挑战赛(10.23-11.14)
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
1
1024程序员开源挑战赛
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d25ae5f6
编写于
4月 20, 2021
作者:
B
baiy
提交者:
ninecents
10月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
utools 窗口关闭支持 开发者工具显示
上级
369a2779
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
2027 addition
and
1748 deletion
+2027
-1748
package-lock.json
package-lock.json
+1960
-1727
package.json
package.json
+1
-1
public/utools.html
public/utools.html
+19
-7
public/utools_preload.js
public/utools_preload.js
+24
-0
src/adapter/utools/plugin.json
src/adapter/utools/plugin.json
+1
-4
src/tool.js
src/tool.js
+1
-0
src/views/setting/block.vue
src/views/setting/block.vue
+21
-9
未找到文件。
package-lock.json
浏览文件 @
d25ae5f6
此差异已折叠。
点击以展开。
package.json
浏览文件 @
d25ae5f6
{
"name"
:
"c-tool"
,
"version"
:
"1.4.
4
"
,
"version"
:
"1.4.
5
"
,
"private"
:
true
,
"scripts"
:
{
"serve"
:
"vue-cli-service serve --port 8081"
,
...
...
public/utools.html
浏览文件 @
d25ae5f6
...
...
@@ -9,23 +9,35 @@
<body>
</body>
<script>
function
setToolCode
(
name
){
function
setToolCode
(
name
)
{
let
data
=
utools
.
db
.
get
(
"
_current_tool_
"
);
let
rev
=
data
?
{
'
_rev
'
:
data
.
_rev
}
:
{}
let
rev
=
data
?
{
'
_rev
'
:
data
.
_rev
}
:
{}
utools
.
db
.
put
({
'
_id
'
:
'
_current_tool_
'
,
'
data
'
:
name
,
'
_id
'
:
'
_current_tool_
'
,
'
data
'
:
name
,
...
rev
})
}
window
.
utools
.
onPluginEnter
(({
code
})
=>
{
window
.
utools
.
onPluginEnter
(({
code
})
=>
{
let
tool
=
""
;
if
(
code
.
indexOf
(
'
ctool-
'
)
!==
-
1
){
if
(
code
.
indexOf
(
'
ctool-
'
)
!==
-
1
)
{
tool
=
code
.
replace
(
/ctool-/g
,
""
)
}
setToolCode
(
tool
)
window
.
utools
.
createBrowserWindow
(
'
tool.html
'
,{
width
:
1200
})
window
.
utools
.
createBrowserWindow
(
'
tool.html
'
,
{
width
:
1200
,
minWidth
:
900
,
minHeight
:
650
,
height
:
650
,
webPreferences
:
{
preload
:
'
utools_preload.js
'
}
}
)
window
.
utools
.
hideMainWindow
()
window
.
utools
.
outPlugin
()
})
...
...
public/utools_preload.js
0 → 100644
浏览文件 @
d25ae5f6
const
{
remote
}
=
require
(
"
electron
"
);
const
browserWindow
=
remote
.
getCurrentWindow
()
browserWindow
.
webContents
.
on
(
'
before-input-event
'
,
(
event
,
input
)
=>
{
// mac 关闭支持
if
(
process
.
platform
===
"
darwin
"
)
{
if
(
input
.
meta
&&
([
'
q
'
,
'
w
'
].
includes
(
input
.
key
.
toLowerCase
())))
{
event
.
preventDefault
()
browserWindow
.
blur
()
browserWindow
.
close
()
}
}
})
window
.
ctool
=
{}
window
.
ctool
.
isDevToolsOpened
=
function
()
{
return
browserWindow
.
webContents
.
isDevToolsOpened
();
}
window
.
ctool
.
toggleDevTools
=
function
()
{
if
(
window
.
ctool
.
isDevToolsOpened
)
{
return
browserWindow
.
webContents
.
closeDevTools
();
}
return
browserWindow
.
webContents
.
openDevTools
();
}
src/adapter/utools/plugin.json
浏览文件 @
d25ae5f6
...
...
@@ -9,8 +9,5 @@
"pluginSetting"
:
{
"single"
:
true
},
"features"
:
"##features##"
,
"development"
:
{
"main"
:
"http://localhost:8081/utools.html"
}
"features"
:
"##features##"
}
\ No newline at end of file
src/tool.js
浏览文件 @
d25ae5f6
...
...
@@ -32,6 +32,7 @@ Vue.component('option-block', optionBlock);
page
.
style
.
width
=
'
auto
'
page
.
style
.
padding
=
'
0 50px
'
page
.
style
.
height
=
'
auto
'
page
.
style
.
minHeight
=
'
600px
'
}
})()
new
Vue
({
...
...
src/views/setting/block.vue
浏览文件 @
d25ae5f6
...
...
@@ -3,7 +3,7 @@
<div>
<CellGroup
@
on-click=
"open"
>
<Cell
title=
"常用工具设置"
name=
"setting"
/>
<Cell
v-if=
"is
C
hrome"
title=
"快捷键设置"
name=
"shortcuts"
/>
<Cell
v-if=
"is
_c
hrome"
title=
"快捷键设置"
name=
"shortcuts"
/>
</CellGroup>
<CellGroup>
<Cell
title=
"自动复制结果到剪贴板"
>
...
...
@@ -12,6 +12,9 @@
<Cell
title=
"自动读取剪贴板内容"
>
<i-switch
v-model=
"auto_read_copy"
slot=
"extra"
/>
</Cell>
<Cell
v-if=
"is_utools"
title=
"页面开发者工具"
>
<i-switch
v-model=
"is_dev_tools_opened"
slot=
"extra"
@
on-change=
"toggleDevTools"
/>
</Cell>
</CellGroup>
</div>
<Drawer
title=
"设置"
placement=
"left"
v-model=
"settingShow"
:width=
"90"
>
...
...
@@ -21,7 +24,7 @@
</
template
>
<
script
>
import
{
openTab
,
isChrome
}
from
'
../../helper
'
import
{
isChrome
,
isUtools
,
openTab
}
from
'
../../helper
'
import
setting
from
'
../../tool/setting
'
import
settingBlock
from
'
./setting
'
...
...
@@ -29,25 +32,29 @@ export default {
components
:
{
"
setting-block
"
:
settingBlock
},
data
()
{
data
()
{
return
{
settingShow
:
false
,
settingShow
:
false
,
auto_save_copy
:
true
,
is_dev_tools_opened
:
false
,
auto_read_copy
:
true
,
isChrome
:
isChrome
,
is_chrome
:
isChrome
,
is_utools
:
isUtools
,
}
},
created
()
{
created
()
{
if
(
isUtools
)
{
this
.
is_dev_tools_opened
=
window
.
ctool
.
isDevToolsOpened
();
}
this
.
auto_save_copy
=
setting
.
autoSaveCopy
()
this
.
auto_read_copy
=
setting
.
autoReadCopy
()
},
beforeDestroy
()
{
beforeDestroy
()
{
setting
.
autoSaveCopy
(
this
.
auto_save_copy
)
setting
.
autoReadCopy
(
this
.
auto_read_copy
)
},
methods
:
{
open
(
name
)
{
console
.
log
(
name
)
open
(
name
)
{
switch
(
name
)
{
case
'
shortcuts
'
:
openTab
(
'
chrome://extensions/shortcuts
'
)
...
...
@@ -57,6 +64,11 @@ export default {
break
}
},
toggleDevTools
()
{
if
(
isUtools
)
{
window
.
ctool
.
toggleDevTools
()
}
}
},
}
</
script
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录