Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private addHotKeys() {
if (this.event.stack_id) {
this.hotkeysService.add(new Hotkey("mod+up", (event: KeyboardEvent): boolean => {
$ExceptionlessClient.createFeatureUsage(`${this._source}.hotkeys.GoToStack`)
.addTags("hotkeys")
.setProperty("id", this.eventId)
.submit();
this.router.navigate([`/type/event/${this.eventId}`]);
return false;
}));
if (this.clipboardService.isSupported) {
this.hotkeysService.add(new Hotkey("mod+shift+c", (event: KeyboardEvent): boolean => {
$ExceptionlessClient.createFeatureUsage(`${this._source}.hotkeys.CopyEventJSON`)
.addTags("hotkeys")
.setProperty("id", this.eventId)
.submit();
this.clipboardService.copyFromContent(this.eventJson);
return false;
}));
}
}
if (this.previous) {
this.hotkeysService.add(new Hotkey("mod+left", (event: KeyboardEvent): boolean => {
$ExceptionlessClient.createFeatureUsage(`${this._source}.hotkeys.PreviousOccurrence`)
.addTags("hotkeys")
.setProperty("id", this.eventId)
.submit();
},
[],
'音量を下げる',
), new Hotkey(
['left', 'mod+left'],
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.player.jumpBackward('11s');
return false;
}
return true;
},
[],
'10秒戻す',
), new Hotkey(
['right', 'mod+right'],
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.player.jumpForward('29s');
return false;
}
return true;
},
[],
'30秒進める',
), new Hotkey(
['shift+left', '['],
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.commentPlayer.delay -= 500;
return false;
constructor(private hotkeysService: HotkeysService, public uiStore: UiStore) {
this.hotkeyShiftSpace = hotkeysService.add(
new Hotkey('shift+space', this.hotkeyShiftSpacePressed, ['INPUT', 'TEXTAREA'], 'Super search')
);
}
updateHotkeys(hotkeys) {
if(this.hotkeys !== undefined) {
this.hotkeyService.add(new Hotkey(this.hotkeys.nextImage, (): boolean =>{ return false }));
this.hotkeyService.add(new Hotkey(this.hotkeys.prevImage, (): boolean =>{ return false }));
}
this.hotkeys = hotkeys;
this.hotkeyService.add(new Hotkey(this.hotkeys.nextImage,
(): boolean => {
this.nextItem();
return false;
}));
this.hotkeyService.add(new Hotkey(this.hotkeys.prevImage,
(): boolean => {
this.previousItem();
return false;
}));
}
}
return true;
},
[],
'コメントを早める',
), new Hotkey(
['shift+right', ']'],
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.commentPlayer.delay += 500;
return false;
}
return true;
},
[],
'コメントを遅らせる',
), new Hotkey(
['o', 'mod+s'],
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.sidebarCollapsed = !this.sidebarCollapsed;
return false;
}
return true;
},
[],
'サイドバーを表示/非表示',
)]);
}
this.hotkeysService.add(new Hotkey("g a", (event: KeyboardEvent): boolean => {
this.router.navigate(["/account/manage"], { queryParams: { tab: "general" } });
return false;
}, null, "Go To My Account"));
this.hotkeysService.add(new Hotkey("g n", (event: KeyboardEvent): boolean => {
this.router.navigate(["/account/manage"], { queryParams: { tab: "notifications" } });
return false;
}, null, "Go To Notifications"));
this.hotkeysService.add(new Hotkey("g d", (event: KeyboardEvent): boolean => {
this.router.navigate(["/dashboard"]);
return false;
}, null, "Go To Dashboard"));
this.hotkeysService.add(new Hotkey("g o", (event: KeyboardEvent): boolean => {
this.router.navigate(["/organization/list"]);
return false;
}, null, "Go To Organizations"));
this.hotkeysService.add(new Hotkey("g p", (event: KeyboardEvent): boolean => {
this.router.navigate(["/project/list"]);
return false;
}, null, "Go To Projects"));
this.hotkeysService.add(new Hotkey("g g", (event: KeyboardEvent): boolean => {
window.open("https://github.com/exceptionless/Exceptionless", "_blank");
return false;
}, null, "Go To GitHub project"));
this.hotkeysService.add(new Hotkey("g s", (event: KeyboardEvent): boolean => {
window.open("http://slack.exceptionless.com", "_blank");
this.hotkeyService.add(new Hotkey(this.hotkeys.line,
(): boolean => {
this.selectCanvasDirective(this.canvasDirectives.canvas_line);
return false;
}));
this.hotkeyService.add(new Hotkey(this.hotkeys.rectangle,
(): boolean => {
this.selectCanvasDirective(this.canvasDirectives.canvas_rect);
return false;
}));
this.hotkeyService.add(new Hotkey(this.hotkeys.polygon,
(): boolean => {
this.selectCanvasDirective(this.canvasDirectives.canvas_polygon);
return false;
}));
this.hotkeyService.add(new Hotkey(this.hotkeys.polyline,
(): boolean => {
this.selectCanvasDirective(this.canvasDirectives.canvas_polyline);
return false;
}));
}
public progressService: ProgressService,
private mdIconRegistry: MatIconRegistry,
private http: HttpClient,
private sanitizer: DomSanitizer,
private renderer: Renderer2,
private ngZone: NgZone,
public logoutservice: LogoutService,
public websocketsearchservice: WebSocketSearchService,
private draftDeskService: DraftDeskService,
public messagelistservice: MessageListService,
changeDetectorRef: ChangeDetectorRef,
public mobileQuery: MobileQueryService,
private swPush: SwPush,
private _hotkeysService: HotkeysService) {
this._hotkeysService.add(new Hotkey(['j', 'k'],
(event: KeyboardEvent, combo: string): ExtendedKeyboardEvent => {
if (combo === 'k') {
this.canvastable.scrollUp();
combo = null;
}
if (combo === 'j') {
this.canvastable.scrollDown();
}
const e: ExtendedKeyboardEvent = event;
e.returnValue = false;
return e;
}));
this.mdIconRegistry.addSvgIcon('movetofolder',
this.sanitizer.bypassSecurityTrustResourceUrl('assets/movetofolder.svg'));
protected initHotkeys() {
this.oldHotkeys = Object.assign([], this.hotkeysService.get());
this.hotkeysService.add([new Hotkey(
's',
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.stop();
return false;
}
return true;
},
[],
'再生を終了',
), new Hotkey(
'space',
(): boolean => {
if (document.elementFromPoint(0, 0).className !== 'cfp-hotkeys') {
this.player.togglePause();
return false;