mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
plugins: implement decorateMenu
This commit is contained in:
parent
7a6fc8ad8c
commit
1aa537b025
1 changed files with 12 additions and 13 deletions
25
plugins.js
25
plugins.js
|
|
@ -255,20 +255,19 @@ exports.onWindow = function (win, app) {
|
|||
});
|
||||
};
|
||||
|
||||
exports.decorateTerm = function (Term) {
|
||||
return Term;
|
||||
};
|
||||
|
||||
exports.decorateTabs = function (Tabs) {
|
||||
return Tabs;
|
||||
};
|
||||
|
||||
exports.decorateHyperTerm = function (HyperTerm) {
|
||||
return HyperTerm;
|
||||
};
|
||||
|
||||
exports.decorateMenu = function (tpl) {
|
||||
return tpl;
|
||||
let decorated = tpl;
|
||||
modules.forEach((plugin) => {
|
||||
if (plugin.decorateMenu) {
|
||||
const res = plugin.decorateMenu(decorated);
|
||||
if (res) {
|
||||
decorated = res;
|
||||
} else {
|
||||
console.error('incompatible response type for `decorateMenu`');
|
||||
}
|
||||
}
|
||||
});
|
||||
return decorated;
|
||||
};
|
||||
|
||||
exports.decorateConfig = function (config) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue