*
This commit is contained in:
@@ -37,10 +37,10 @@ function Acels (client) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.shiftKey) {
|
||||
return `CmdOrCtrl+Shift+${accelerator}`
|
||||
}
|
||||
if (event.shiftKey) {
|
||||
if (event.shiftKey && event.key.toUpperCase() !== event.key) {
|
||||
return `Shift+${accelerator}`
|
||||
}
|
||||
if (event.altKey) {
|
||||
if (event.altKey && event.key.length !== 1) {
|
||||
return `Alt+${accelerator}`
|
||||
}
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
@@ -73,7 +73,7 @@ function Acels (client) {
|
||||
for (const cat in cats) {
|
||||
text += `\n### ${cat}\n\n`
|
||||
for (const item of cats[cat]) {
|
||||
text += item.accelerator ? `- \`${item.accelerator}\`: ${item.info}\n` : ''
|
||||
text += item.accelerator ? `- \`${item.accelerator.replace('`', 'tilde')}\`: ${item.name}\n` : ''
|
||||
}
|
||||
}
|
||||
return text.trim()
|
||||
@@ -83,8 +83,9 @@ function Acels (client) {
|
||||
const cats = this.sort()
|
||||
let text = ''
|
||||
for (const cat in cats) {
|
||||
text += `\n${cat}\n\n`
|
||||
for (const item of cats[cat]) {
|
||||
text += item.accelerator ? `${cat}: ${item.name} | ${item.accelerator}\n` : ''
|
||||
text += item.accelerator ? `${item.name.padEnd(25, '.')} ${item.accelerator}\n` : ''
|
||||
}
|
||||
}
|
||||
return text.trim()
|
||||
@@ -105,13 +106,13 @@ function Acels (client) {
|
||||
submenu: [
|
||||
{ label: 'Download Themes', click: () => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes') } },
|
||||
{ label: 'Open Theme', click: () => { client.theme.open() } },
|
||||
{ label: 'Reset Theme', click: () => { client.theme.reset() } }
|
||||
{ label: 'Reset Theme', accelerator: 'CmdOrCtrl+Escape', click: () => { client.theme.reset() } }
|
||||
]
|
||||
},
|
||||
{ label: 'Fullscreen', accelerator: 'CmdOrCtrl+Enter', click: () => { app.toggleFullscreen() } },
|
||||
{ label: 'Hide', accelerator: 'CmdOrCtrl+H', click: () => { app.toggleVisible() } },
|
||||
{ label: 'Toggle Menubar', accelerator: 'Alt+H', click: () => { app.toggleMenubar() } },
|
||||
{ label: 'Inspect', accelerator: 'CmdOrCtrl+.', click: () => { app.inspect() } },
|
||||
{ label: 'Inspect', accelerator: 'CmdOrCtrl+Tab', click: () => { app.inspect() } },
|
||||
{ role: 'quit' }
|
||||
]
|
||||
})
|
||||
|
||||
@@ -18,14 +18,14 @@ function Source (client) {
|
||||
this.cache = {}
|
||||
}
|
||||
|
||||
this.open = (ext, callback) => {
|
||||
this.open = (ext, callback, store = false) => {
|
||||
console.log('Source', 'Open file..')
|
||||
const input = document.createElement('input')
|
||||
input.type = 'file'
|
||||
input.onchange = (e) => {
|
||||
const file = e.target.files[0]
|
||||
if (file.name.indexOf('.' + ext) < 0) { console.warn('Source', `Skipped ${file.name}`); return }
|
||||
this.read(file, callback)
|
||||
this.read(file, callback, store)
|
||||
}
|
||||
input.click()
|
||||
}
|
||||
@@ -37,7 +37,7 @@ function Source (client) {
|
||||
input.setAttribute('multiple', 'multiple')
|
||||
input.onchange = (e) => {
|
||||
for (const file of e.target.files) {
|
||||
if (file.name.indexOf('.' + ext) < 0) { console.warn('Source', `Skipped ${file.name}`); return }
|
||||
if (file.name.indexOf('.' + ext) < 0) { console.warn('Source', `Skipped ${file.name}`); continue }
|
||||
this.read(file, this.store)
|
||||
}
|
||||
}
|
||||
@@ -60,11 +60,12 @@ function Source (client) {
|
||||
|
||||
// I/O
|
||||
|
||||
this.read = (file, callback) => {
|
||||
this.read = (file, callback, store = false) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = (event) => {
|
||||
const res = event.target.result
|
||||
if (callback) { callback(file, res) }
|
||||
if (store) { this.store(file, res) }
|
||||
}
|
||||
reader.readAsText(file, 'UTF-8')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user