moved onctext definitions in mzta-utils.js
This commit is contained in:
parent
0b62350138
commit
5c2e7a63f6
2 changed files with 8 additions and 3 deletions
|
|
@ -19,14 +19,14 @@
|
||||||
// Some original methods are derived from https://github.com/ali-raheem/Aify/blob/cfadf52f576b7be3720b5b73af7c8d3129c054da/plugin/html/actions.js
|
// Some original methods are derived from https://github.com/ali-raheem/Aify/blob/cfadf52f576b7be3720b5b73af7c8d3129c054da/plugin/html/actions.js
|
||||||
|
|
||||||
import { getPrompts } from './mzta-prompts.js';
|
import { getPrompts } from './mzta-prompts.js';
|
||||||
import { getLanguageDisplayName } from './mzta-utils.js'
|
import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay } from './mzta-utils.js'
|
||||||
|
|
||||||
export class mzta_Menus {
|
export class mzta_Menus {
|
||||||
|
|
||||||
allPrompts = [];
|
allPrompts = [];
|
||||||
openChatGPT = null;
|
openChatGPT = null;
|
||||||
menu_context_compose = 'compose_action_menu';
|
menu_context_compose = null;
|
||||||
menu_context_display = 'message_display_action_menu';
|
menu_context_display = null;
|
||||||
menu_listeners = {};
|
menu_listeners = {};
|
||||||
|
|
||||||
rootMenu = [
|
rootMenu = [
|
||||||
|
|
@ -34,6 +34,8 @@ export class mzta_Menus {
|
||||||
];
|
];
|
||||||
|
|
||||||
constructor(openChatGPT) {
|
constructor(openChatGPT) {
|
||||||
|
this.menu_context_compose = getMenuContextCompose();
|
||||||
|
this.menu_context_display = getMenuContextDisplay();
|
||||||
this.openChatGPT = openChatGPT;
|
this.openChatGPT = openChatGPT;
|
||||||
this.allPrompts = [];
|
this.allPrompts = [];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export const getMenuContextCompose = () => 'compose_action_menu';
|
||||||
|
export const getMenuContextDisplay = () => 'message_display_action_menu';
|
||||||
|
|
||||||
|
|
||||||
export function getLanguageDisplayName(languageCode) {
|
export function getLanguageDisplayName(languageCode) {
|
||||||
const languageDisplay = new Intl.DisplayNames([languageCode], {type: 'language'});
|
const languageDisplay = new Intl.DisplayNames([languageCode], {type: 'language'});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue