mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
01e86e2732
commit
bbca23b47d
1 changed files with 29 additions and 29 deletions
|
|
@ -154,38 +154,38 @@
|
||||||
<img id="icon">
|
<img id="icon">
|
||||||
<div class="drag"></div>
|
<div class="drag"></div>
|
||||||
<script>
|
<script>
|
||||||
const getSearch = (key) => {
|
const getSearch = (key) => {
|
||||||
if (window.location.search.indexOf('?') === -1) {
|
if (window.location.search.indexOf('?') === -1) {
|
||||||
return ''
|
return ''
|
||||||
|
}
|
||||||
|
let value = ''
|
||||||
|
const data = window.location.search.split('?')[1].split('&')
|
||||||
|
data.find(item => {
|
||||||
|
const keyValue = item.split('=')
|
||||||
|
if (keyValue[0] === key) {
|
||||||
|
value = keyValue[1]
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return value
|
||||||
}
|
}
|
||||||
let value = ''
|
|
||||||
const data = window.location.search.split('?')[1].split('&')
|
document.querySelector('#icon').src = decodeURIComponent(`${getSearch('icon')}`)
|
||||||
data.find(item => {
|
|
||||||
const keyValue = item.split('=')
|
document.getElementById('title').innerHTML = decodeURIComponent(getSearch('title'))
|
||||||
if (keyValue[0] === key) {
|
document.getElementById('content').innerHTML = decodeURIComponent(getSearch('content'))
|
||||||
value = keyValue[1]
|
document.querySelectorAll('.version').forEach(item => {
|
||||||
return true
|
item.textContent = `🔖 v${getSearch('v')}`
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelector('#icon').src = decodeURIComponent(`${getSearch('icon')}`)
|
document.getElementById('close').addEventListener('click', () => {
|
||||||
|
const {getCurrentWindow} = require('@electron/remote')
|
||||||
document.getElementById('title').innerHTML = decodeURIComponent(getSearch('title'))
|
getCurrentWindow().destroy()
|
||||||
document.getElementById('content').innerHTML = decodeURIComponent(getSearch('content'))
|
})
|
||||||
document.querySelectorAll('.version').forEach(item => {
|
document.getElementById('min').addEventListener('click', () => {
|
||||||
item.textContent = `🔖 v${getSearch('v')}`
|
const {getCurrentWindow} = require('@electron/remote')
|
||||||
})
|
getCurrentWindow().minimize()
|
||||||
|
})
|
||||||
document.getElementById('close').addEventListener('click', () => {
|
|
||||||
const {ipcRenderer} = require('electron')
|
|
||||||
ipcRenderer.send('siyuan-first-quit')
|
|
||||||
})
|
|
||||||
document.getElementById('min').addEventListener('click', () => {
|
|
||||||
const {getCurrentWindow} = require('@electron/remote')
|
|
||||||
getCurrentWindow().minimize()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue