debian-mirror-gitlab/app/assets/javascripts/ide/stores/plugins/terminal.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
775 B
JavaScript
Raw Normal View History

2020-06-23 00:09:42 +05:30
import * as mutationTypes from '~/ide/stores/mutation_types';
import terminalModule from '../modules/terminal';
function getPathsFromData(el) {
return {
2022-06-21 17:19:12 +05:30
webTerminalSvgPath: el.dataset.webTerminalSvgPath,
webTerminalHelpPath: el.dataset.webTerminalHelpPath,
webTerminalConfigHelpPath: el.dataset.webTerminalConfigHelpPath,
webTerminalRunnersHelpPath: el.dataset.webTerminalRunnersHelpPath,
2020-06-23 00:09:42 +05:30
};
}
export default function createTerminalPlugin(el) {
2021-03-08 18:12:59 +05:30
return (store) => {
2020-06-23 00:09:42 +05:30
store.registerModule('terminal', terminalModule());
store.dispatch('terminal/setPaths', getPathsFromData(el));
store.subscribe(({ type }) => {
if (type === mutationTypes.SET_BRANCH_WORKING_REFERENCE) {
store.dispatch('terminal/init');
}
});
};
}