mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
lint
This commit is contained in:
@@ -3,7 +3,6 @@ import { ToolbarButtonProvider, IToolbarButton, AppService } from 'terminus-core
|
||||
|
||||
import { SettingsTabComponent } from './components/settingsTab.component'
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class ButtonProvider extends ToolbarButtonProvider {
|
||||
constructor (
|
||||
|
@@ -5,45 +5,44 @@ import { HotkeysService } from 'terminus-core'
|
||||
|
||||
const INPUT_TIMEOUT = 1000
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'hotkey-input-modal',
|
||||
template: require('./hotkeyInputModal.component.pug'),
|
||||
styles: [require('./hotkeyInputModal.component.scss')],
|
||||
animations: [
|
||||
trigger('animateKey', [
|
||||
transition(':enter', [
|
||||
style({
|
||||
transform: 'translateX(25px)',
|
||||
opacity: '0',
|
||||
}),
|
||||
animate('250ms ease-out', style({
|
||||
transform: 'translateX(0)',
|
||||
opacity: '1',
|
||||
}))
|
||||
]),
|
||||
transition(':leave', [
|
||||
style({
|
||||
transform: 'translateX(0)',
|
||||
opacity: '1',
|
||||
}),
|
||||
animate('250ms ease-in', style({
|
||||
transform: 'translateX(25px)',
|
||||
opacity: '0',
|
||||
}))
|
||||
])
|
||||
])
|
||||
]
|
||||
selector: 'hotkey-input-modal',
|
||||
template: require('./hotkeyInputModal.component.pug'),
|
||||
styles: [require('./hotkeyInputModal.component.scss')],
|
||||
animations: [
|
||||
trigger('animateKey', [
|
||||
transition(':enter', [
|
||||
style({
|
||||
transform: 'translateX(25px)',
|
||||
opacity: '0',
|
||||
}),
|
||||
animate('250ms ease-out', style({
|
||||
transform: 'translateX(0)',
|
||||
opacity: '1',
|
||||
}))
|
||||
]),
|
||||
transition(':leave', [
|
||||
style({
|
||||
transform: 'translateX(0)',
|
||||
opacity: '1',
|
||||
}),
|
||||
animate('250ms ease-in', style({
|
||||
transform: 'translateX(25px)',
|
||||
opacity: '0',
|
||||
}))
|
||||
])
|
||||
])
|
||||
]
|
||||
})
|
||||
export class HotkeyInputModalComponent {
|
||||
@Input() value: string[] = []
|
||||
@Input() timeoutProgress = 0
|
||||
|
||||
private keySubscription: Subscription
|
||||
private lastKeyEvent: number
|
||||
private keyTimeoutInterval: number = null
|
||||
|
||||
@Input() value: string[] = []
|
||||
@Input() timeoutProgress = 0
|
||||
|
||||
constructor(
|
||||
constructor (
|
||||
private modalInstance: NgbActiveModal,
|
||||
public hotkeys: HotkeysService,
|
||||
) {
|
||||
@@ -66,7 +65,7 @@ export class HotkeyInputModalComponent {
|
||||
return
|
||||
}
|
||||
this.timeoutProgress = Math.min(100, (performance.now() - this.lastKeyEvent) * 100 / INPUT_TIMEOUT)
|
||||
if (this.timeoutProgress == 100) {
|
||||
if (this.timeoutProgress === 100) {
|
||||
this.modalInstance.close(this.value)
|
||||
}
|
||||
}, 25)
|
||||
@@ -78,7 +77,7 @@ export class HotkeyInputModalComponent {
|
||||
clearInterval(this.keyTimeoutInterval)
|
||||
}
|
||||
|
||||
close() {
|
||||
close () {
|
||||
this.modalInstance.dismiss()
|
||||
}
|
||||
}
|
||||
|
@@ -2,14 +2,16 @@ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { HotkeyInputModalComponent } from './hotkeyInputModal.component'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'multi-hotkey-input',
|
||||
template: require('./multiHotkeyInput.component.pug'),
|
||||
styles: [require('./multiHotkeyInput.component.scss')],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
selector: 'multi-hotkey-input',
|
||||
template: require('./multiHotkeyInput.component.pug'),
|
||||
styles: [require('./multiHotkeyInput.component.scss')],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class MultiHotkeyInputComponent {
|
||||
@Input() model: string[][]
|
||||
@Output() modelChange = new EventEmitter()
|
||||
|
||||
constructor (
|
||||
private ngbModal: NgbModal,
|
||||
) { }
|
||||
@@ -18,10 +20,10 @@ export class MultiHotkeyInputComponent {
|
||||
if (!this.model) {
|
||||
this.model = []
|
||||
}
|
||||
if (typeof this.model == 'string') {
|
||||
if (typeof this.model === 'string') {
|
||||
this.model = [this.model]
|
||||
}
|
||||
this.model = this.model.map(item => (typeof item == 'string') ? [item] : item)
|
||||
this.model = this.model.map(item => (typeof item === 'string') ? [item] : item)
|
||||
}
|
||||
|
||||
editItem (item) {
|
||||
@@ -43,7 +45,4 @@ export class MultiHotkeyInputComponent {
|
||||
this.model = this.model.filter(x => x !== item)
|
||||
this.modelChange.emit(this.model)
|
||||
}
|
||||
|
||||
@Input() model: string[][]
|
||||
@Output() modelChange = new EventEmitter()
|
||||
}
|
||||
|
@@ -3,20 +3,19 @@ import { ElectronService, DockingService, ConfigService, IHotkeyDescription, Hot
|
||||
|
||||
import { SettingsTabProvider } from '../api'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'settings-tab',
|
||||
template: require('./settingsTab.component.pug'),
|
||||
styles: [
|
||||
require('./settingsTab.component.scss'),
|
||||
require('./settingsTab.deep.component.css'),
|
||||
],
|
||||
selector: 'settings-tab',
|
||||
template: require('./settingsTab.component.pug'),
|
||||
styles: [
|
||||
require('./settingsTab.component.scss'),
|
||||
require('./settingsTab.deep.component.css'),
|
||||
],
|
||||
})
|
||||
export class SettingsTabComponent extends BaseTabComponent {
|
||||
hotkeyFilter = { name: null }
|
||||
private hotkeyDescriptions: IHotkeyDescription[]
|
||||
|
||||
constructor(
|
||||
constructor (
|
||||
public config: ConfigService,
|
||||
private electron: ElectronService,
|
||||
public docking: DockingService,
|
||||
|
@@ -1,10 +1,9 @@
|
||||
import { Component, Input, ViewContainerRef, ViewChild, ComponentFactoryResolver, ComponentRef } from '@angular/core'
|
||||
import { SettingsTabProvider } from '../api'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'settings-tab-body',
|
||||
template: '<ng-template #placeholder></ng-template>',
|
||||
selector: 'settings-tab-body',
|
||||
template: '<ng-template #placeholder></ng-template>',
|
||||
})
|
||||
export class SettingsTabBodyComponent {
|
||||
@Input() provider: SettingsTabProvider
|
||||
|
@@ -14,7 +14,6 @@ import { SettingsTabBodyComponent } from './components/settingsTabBody.component
|
||||
import { ButtonProvider } from './buttonProvider'
|
||||
import { RecoveryProvider } from './recoveryProvider'
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
@@ -3,17 +3,16 @@ import { TabRecoveryProvider, AppService } from 'terminus-core'
|
||||
|
||||
import { SettingsTabComponent } from './components/settingsTab.component'
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class RecoveryProvider extends TabRecoveryProvider {
|
||||
constructor(
|
||||
constructor (
|
||||
private app: AppService
|
||||
) {
|
||||
super()
|
||||
}
|
||||
|
||||
async recover (recoveryToken: any): Promise<void> {
|
||||
if (recoveryToken.type == 'app:settings') {
|
||||
if (recoveryToken.type === 'app:settings') {
|
||||
this.app.openNewTab(SettingsTabComponent)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user