diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md
new file mode 100644
index 0000000..7f7de61
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.md
@@ -0,0 +1,24 @@
+---
+name: Bug report
+about: 报告一个bug
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**描述一下这个bug**
+清楚而简洁地描述了错误是什么
+
+**复现方式**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**预期行为**
+清晰简明地描述了您预期的发生。
+
+**截图**
+如果可以,请添加屏幕截图以帮助解释您的问题。
diff --git a/.github/ISSUE_TEMPLATE/development-problem.md b/.github/ISSUE_TEMPLATE/development-problem.md
new file mode 100644
index 0000000..140e48d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/development-problem.md
@@ -0,0 +1,10 @@
+---
+name: Development Problem
+about: 任何开发建议、使用问题、交流学习都可以
+title: ''
+labels: help wanted
+assignees: ''
+
+---
+
+## 任何开发建议、交流学习都可以
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..a7e39dd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,17 @@
+---
+name: Feature request
+about: 提交一个新特性/功能
+title: ''
+labels: feature
+assignees: ''
+
+---
+
+**您的功能请求是否与问题相关? 请简单描述.**
+清晰简明地描述问题是什么. Ex. I'm always frustrated when [...]
+
+**请描述一下您想要的解决方案**
+清晰简明地描述您想要发生的事情。
+
+**描述你考虑过的替代方案**
+清晰简洁地描述您所考虑的任何替代解决方案或功能。
diff --git a/README.md b/README.md
index ff31877..c916a2d 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,45 @@
-
@@ -29,7 +33,12 @@
- item.click($router)" class="op-item" slot="renderItem" slot-scope="item, index">
+ item.click($router)"
+ :class="currentSelect === index ? 'active op-item' : 'op-item'"
+ slot="renderItem"
+ slot-scope="item, index"
+ >
@@ -51,8 +60,10 @@
onSearch({value: e.target.value, searchType: $route.query.searchType})"
+ @change="(e) => search({value: e.target.value, searchType: $route.query.searchType})"
:value="searchValue"
+ @keypress.enter="(e) => targetSearch({value: e.target.value, type: 'enter'})"
+ @keypress.space="(e) => targetSearch({value: e.target.value, type: 'space'})"
>
@@ -68,7 +79,7 @@
import {mapActions, mapMutations, mapState} from "vuex";
import {ipcRenderer, remote} from "electron";
import {getWindowHeight, debounce} from "./assets/common/utils";
-
+const opConfig = remote.getGlobal('opConfig');
const {Menu, MenuItem} = remote;
export default {
@@ -77,18 +88,28 @@ export default {
searchType: this.$route.query.searchType ? 'subWindow' : '',
query: this.$route.query,
searchFn: null,
+ config: opConfig.get(),
+ currentSelect: 0,
}
},
mounted() {
- // 注册快捷键
- ipcRenderer.send('init-shortcut');
ipcRenderer.on('init-rubick', this.closeTag);
ipcRenderer.on('new-window', this.newWindow);
+ // 超级面板打开插件
+ ipcRenderer.on('superPanel-openPlugin', (e, args) => {
+ this.openPlugin({
+ cmd: args.cmd,
+ plugin: args.plugin,
+ feature: args.feature,
+ router: this.$router,
+ payload: args.data,
+ })
+ });
const searchNd = document.getElementById('search');
searchNd && searchNd.addEventListener('keydown', this.checkNeedInit)
},
methods: {
- ...mapActions('main', ['onSearch', 'showMainUI']),
+ ...mapActions('main', ['onSearch', 'showMainUI', 'openPlugin']),
...mapMutations('main', ['commonUpdate']),
search(v) {
if (!this.searchFn) {
@@ -96,6 +117,26 @@ export default {
}
this.searchFn(v);
},
+ targetSearch(action) {
+ // 在插件界面唤起搜索功能
+ if((this.selected && this.selected.key === 'plugin-container') || this.searchType === 'subWindow') {
+ const webview = document.getElementById('webview');
+ if (action.type === 'space') {
+ if (this.config.perf.common.space) {
+ webview.send('msg-back-setSubInput', this.searchValue);
+ }
+ return;
+ }
+ webview.send('msg-back-setSubInput', this.searchValue);
+ } else if (this.showOptions) {
+ const item = this.options[this.currentSelect]
+ item.click(this.$router);
+ }
+ },
+ changeCurrent(index) {
+ this.currentSelect = this.currentSelect + index;
+ },
+
renderTitle(title) {
const result = title.split(this.searchValue);
return `
${result[0]}${this.searchValue}${result[1]}
`
@@ -234,6 +275,9 @@ export default {
max-height: 500px;
overflow: auto;
background: #fafafa;
+ &.active {
+ background: #DEE2E8;
+ }
}
}
}
diff --git a/src/renderer/assets/common/utils.js b/src/renderer/assets/common/utils.js
index d233181..1668661 100644
--- a/src/renderer/assets/common/utils.js
+++ b/src/renderer/assets/common/utils.js
@@ -4,7 +4,7 @@ import fs from 'fs';
import process from 'child_process';
import Store from 'electron-store';
import downloadFile from 'download';
-import {nativeImage} from 'electron';
+import {nativeImage, ipcRenderer} from 'electron';
import {APP_FINDER_PATH} from './constans';
import {getlocalDataFile} from "../../../main/common/utils";
@@ -57,6 +57,19 @@ async function downloadZip(downloadRepoUrl, name) {
const sysFile = {
savePlugins(plugins) {
+ ipcRenderer.send('optionPlugin', {
+ plugins: plugins.filter((plugin) => {
+ let hasOption = false;
+ plugin.features.forEach(fe => {
+ fe.cmds.forEach(cmd => {
+ if (cmd.type) {
+ hasOption = true;
+ }
+ })
+ });
+ return hasOption;
+ })
+ });
store.set('user-plugins', plugins);
},
getUserPlugins() {
@@ -72,7 +85,7 @@ const sysFile = {
}
function mergePlugins(plugins) {
- return [
+ const result = [
...plugins,
...SYSTEM_PLUGINS.map(plugin => {
return {
@@ -81,8 +94,18 @@ function mergePlugins(plugins) {
sourceFile: '',
type: 'system',
}
- }),
+ })
]
+
+ return result.filter((item, i) => {
+ let targetIndex;
+ result.forEach((tg, j) => {
+ if (tg.tag === item.tag && tg.type === 'system') {
+ targetIndex = j
+ }
+ });
+ return i === targetIndex;
+ });
}
function find(p, target = 'plugin.json') {
diff --git a/src/renderer/assets/keycode.js b/src/renderer/assets/keycode.js
index 13adf27..59fcc11 100644
--- a/src/renderer/assets/keycode.js
+++ b/src/renderer/assets/keycode.js
@@ -18,19 +18,14 @@ export default {
32: 'space',
33: 'page up',
34: 'page down',
- 35: 'end',
- 36: 'home',
- 37: 'left arrow',
- 38: 'up arrow',
- 39: 'right arrow',
- 40: 'down arrow',
- 41: 'select',
- 42: 'print',
- 43: 'execute',
- 44: 'Print Screen',
- 45: 'insert',
- 46: 'delete',
- 47: 'help',
+ 35: 'End',
+ 36: 'Home',
+ 37: 'Left',
+ 38: 'Up',
+ 39: 'Right',
+ 40: 'Down',
+ 45: 'Insert',
+ 46: 'Delete',
48: '0',
49: '1',
50: '2',
@@ -41,130 +36,55 @@ export default {
55: '7',
56: '8',
57: '9',
- 58: ':',
- 59: 'semicolon (firefox), equals',
- 60: '<',
- 61: 'equals (firefox)',
- 63: 'ß',
- 64: '@ (firefox)',
- 65: 'a',
- 66: 'b',
- 67: 'c',
- 68: 'd',
- 69: 'e',
- 70: 'f',
- 71: 'g',
- 72: 'h',
- 73: 'i',
- 74: 'j',
- 75: 'k',
- 76: 'l',
- 77: 'm',
- 78: 'n',
- 79: 'o',
- 80: 'p',
- 81: 'q',
- 82: 'r',
- 83: 's',
- 84: 't',
- 85: 'u',
- 86: 'v',
- 87: 'w',
- 88: 'x',
- 89: 'y',
- 90: 'z',
- 91: 'Windows Key / Left ⌘ / Chromebook Search key',
- 92: 'right window key',
- 93: 'Windows Menu / Right ⌘',
- 95: 'sleep',
- 96: 'numpad 0',
- 97: 'numpad 1',
- 98: 'numpad 2',
- 99: 'numpad 3',
- 100: 'numpad 4',
- 101: 'numpad 5',
- 102: 'numpad 6',
- 103: 'numpad 7',
- 104: 'numpad 8',
- 105: 'numpad 9',
- 106: 'multiply',
- 107: 'add',
- 108: 'numpad period (firefox)',
- 109: 'subtract',
- 110: 'decimal point',
- 111: 'divide',
- 112: 'f1',
- 113: 'f2',
- 114: 'f3',
- 115: 'f4',
- 116: 'f5',
- 117: 'f6',
- 118: 'f7',
- 119: 'f8',
- 120: 'f9',
- 121: 'f10',
- 122: 'f11',
- 123: 'f12',
- 124: 'f13',
- 125: 'f14',
- 126: 'f15',
- 127: 'f16',
- 128: 'f17',
- 129: 'f18',
- 130: 'f19',
- 131: 'f20',
- 132: 'f21',
- 133: 'f22',
- 134: 'f23',
- 135: 'f24',
- 136: 'f25',
- 137: 'f26',
- 138: 'f27',
- 139: 'f28',
- 140: 'f29',
- 141: 'f30',
- 142: 'f31',
- 143: 'f32',
- 144: 'num lock',
- 145: 'scroll lock',
- 151: 'airplane mode',
- 160: '^',
- 161: '!',
- 162: '؛ (arabic semicolon)',
- 163: '#',
- 164: '$',
- 165: 'ù',
- 166: 'page backward',
- 167: 'page forward',
- 168: 'refresh',
- 169: 'closing paren (AZERTY)',
- 170: '*',
- 171: '~ + * key',
- 172: 'home key',
- 173: 'minus (firefox), mute/unmute',
- 174: 'decrease volume level',
- 175: 'increase volume level',
- 176: 'next',
- 177: 'previous',
- 178: 'stop',
- 179: 'play/pause',
- 180: 'e-mail',
- 181: 'mute/unmute (firefox)',
- 182: 'decrease volume level (firefox)',
- 183: 'increase volume level (firefox)',
- 186: 'semi-colon / ñ',
- 187: 'equal sign',
- 188: 'comma',
- 189: 'dash',
- 190: 'period',
- 191: 'forward slash / ç',
- 192: 'grave accent / ñ / æ / ö',
- 193: '?, / or °',
- 194: 'numpad period (chrome)',
- 219: 'open bracket',
- 220: 'back slash',
- 221: 'close bracket / å',
- 222: 'single quote / ø / ä',
+ 65: 'A',
+ 66: 'B',
+ 67: 'C',
+ 68: 'D',
+ 69: 'E',
+ 70: 'F',
+ 71: 'G',
+ 72: 'H',
+ 73: 'I',
+ 74: 'J',
+ 75: 'K',
+ 76: 'L',
+ 77: 'M',
+ 78: 'N',
+ 79: 'O',
+ 80: 'P',
+ 81: 'Q',
+ 82: 'R',
+ 83: 'S',
+ 84: 'T',
+ 85: 'U',
+ 86: 'V',
+ 87: 'W',
+ 88: 'X',
+ 89: 'Y',
+ 90: 'Z',
+ 112: 'F1',
+ 113: 'F2',
+ 114: 'F3',
+ 115: 'F4',
+ 116: 'F5',
+ 117: 'F6',
+ 118: 'F7',
+ 119: 'F8',
+ 120: 'F9',
+ 121: 'F10',
+ 122: 'F11',
+ 123: 'F12',
+ 186: ';',
+ 187: '=',
+ 188: ',',
+ 189: '-',
+ 190: '.',
+ 191: '/',
+ 192: '`',
+ 219: '[',
+ 220: '\\',
+ 221: ']',
+ 222: "'",
223: '`',
224: 'left or right ⌘ key (firefox)',
225: 'altgr',
diff --git a/src/renderer/main.js b/src/renderer/main.js
index bb3136b..15c1555 100644
--- a/src/renderer/main.js
+++ b/src/renderer/main.js
@@ -1,6 +1,7 @@
import Vue from 'vue'
import axios from 'axios'
-
+import ioHook from 'iohook';
+import {ipcRenderer, remote} from 'electron';
import App from './App'
import router from './router'
import store from './store'
@@ -8,9 +9,11 @@ import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
+const opConfig = remote.getGlobal('opConfig');
+
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
Vue.use(Antd);
@@ -20,4 +23,24 @@ new Vue({
router,
store,
template: '
'
-}).$mount('#app')
+}).$mount('#app');
+
+ioHook.start(false);
+
+let down_time = 0;
+let isPress = false;
+ioHook.on('mousedown', (e) => {
+ if (e.button === 1) return;
+ isPress = true;
+ down_time = Date.now();
+ const config = opConfig.get();
+ setTimeout(async () => {
+ if (isPress) {
+ ipcRenderer.send('right-down');
+ }
+ }, config.superPanel.mouseDownTime);
+})
+ioHook.on('mouseup', (e) => {
+ if(e.button === 1) return;
+ isPress = false;
+});
diff --git a/src/renderer/pages/plugins/index.vue b/src/renderer/pages/plugins/index.vue
index adf872e..5438094 100644
--- a/src/renderer/pages/plugins/index.vue
+++ b/src/renderer/pages/plugins/index.vue
@@ -30,8 +30,8 @@ export default {
mounted() {
this.webview = document.querySelector('webview');
this.webview.addEventListener('dom-ready', () => {
- this.webview.send('onPluginReady', this.$route.query);
- this.webview.send('onPluginEnter', this.$route.query);
+ this.webview.send('onPluginReady', this.pluginInfo);
+ this.webview.send('onPluginEnter', this.pluginInfo);
});
this.setSubPlaceHolder('Hi, Rubick');
this.webview.addEventListener('ipc-message', (event) => {
@@ -74,22 +74,19 @@ export default {
...mapMutations('main', ['setSubPlaceHolder', 'commonUpdate']),
},
beforeRouteUpdate() {
- this.path = `File://${this.$route.query.sourceFile}`
+ this.path = `File://${this.$route.query.sourceFile}`;
+ console.log(this.pluginInfo)
+ this.webview.send('onPluginEnter', this.pluginInfo);
},
beforeDestroy() {
const webview = document.querySelector('webview');
webview && webview.send('onPluginOut', this.$route.query)
},
computed: {
- ...mapState('main', ['searchValue', 'devPlugins']),
+ ...mapState('main', ['searchValue', 'devPlugins', 'pluginInfo']),
pluginDetail() {
return (this.devPlugins.filter(plugin => plugin.name === this.query.name)[0] || {}).features
},
- },
- watch: {
- searchValue() {
- this.webview.send('msg-back-setSubInput', this.searchValue);
- }
}
}
diff --git a/src/renderer/pages/search/subpages/settings.vue b/src/renderer/pages/search/subpages/settings.vue
index 589bdf8..80bf9a0 100644
--- a/src/renderer/pages/search/subpages/settings.vue
+++ b/src/renderer/pages/search/subpages/settings.vue
@@ -6,14 +6,11 @@
偏好设置
- 本地启动文件
+ 超级面板
全局快捷键
-
- 所有关键字
-
+