mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-16 15:50:31 +08:00
feat: 支持文本模板,系统命令
This commit is contained in:
@@ -2,7 +2,6 @@ import doc from './doc.js';
|
||||
function getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
console.log(vars);
|
||||
for (var i=0;i<vars.length;i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if(pair[0] == variable){return pair[1];}
|
||||
@@ -15,10 +14,10 @@ const routes = [
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes // (缩写) 相当于 routes: routes
|
||||
routes
|
||||
})
|
||||
|
||||
const app = new Vue({
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
config: window.exports,
|
||||
12
static/plugins/picker/index.html
Normal file
12
static/plugins/picker/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Picker</title>
|
||||
<link rel="stylesheet" href="./picker.css" />
|
||||
<script defer src="./picker.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section id="picker"></section>
|
||||
</body>
|
||||
</html>
|
||||
17
static/plugins/picker/picker.css
Normal file
17
static/plugins/picker/picker.css
Normal file
@@ -0,0 +1,17 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background: transparent;
|
||||
cursor: crosshair;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#picker {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 120px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
23
static/plugins/picker/picker.js
Normal file
23
static/plugins/picker/picker.js
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
const { ipcRenderer } = require("electron");
|
||||
|
||||
document.querySelector(
|
||||
"#picker"
|
||||
).style.border = `10px solid rgba(200, 200, 200, 0.3)`;
|
||||
|
||||
document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
() => ipcRenderer.send("pickerRequested"),
|
||||
false
|
||||
);
|
||||
document.addEventListener(
|
||||
"keydown",
|
||||
(event) => {
|
||||
if (event.key === "Escape") ipcRenderer.send("closePicker");
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
ipcRenderer.on("updatePicker", (event, color) => {
|
||||
document.querySelector("#picker").style.border = `10px solid ${color}`;
|
||||
});
|
||||
Reference in New Issue
Block a user