Files
mattermost/app/command_shortcuts.go
Saturnino Abril 9097289c2c [PLT-3377] Open up a shortcuts dialog instead of printing help text (#7064)
* open up a shortcuts dialog instead of printing help text

* Updating UI for keyboard shortcuts modal

* update PR per PLT-7284

* fix typo error

* fix mixed up shortcut keys

* move to client side

* fix shortcuts list, remove unused function and revert server side code for autocompletion

* remove quick team switcher
2017-08-18 17:04:05 +08:00

43 lines
1.1 KiB
Go

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
import (
"github.com/mattermost/platform/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type ShortcutsProvider struct {
}
const (
CMD_SHORTCUTS = "shortcuts"
)
func init() {
RegisterCommandProvider(&ShortcutsProvider{})
}
func (me *ShortcutsProvider) GetTrigger() string {
return CMD_SHORTCUTS
}
func (me *ShortcutsProvider) GetCommand(T goi18n.TranslateFunc) *model.Command {
return &model.Command{
Trigger: CMD_SHORTCUTS,
AutoComplete: true,
AutoCompleteDesc: T("api.command_shortcuts.desc"),
AutoCompleteHint: "",
DisplayName: T("api.command_shortcuts.name"),
}
}
func (me *ShortcutsProvider) DoCommand(args *model.CommandArgs, message string) *model.CommandResponse {
// This command is handled client-side and shouldn't hit the server.
return &model.CommandResponse{
Text: args.T("api.command_shortcuts.unsupported.app_error"),
ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL,
}
}