Skip to content
Snippets Groups Projects
Commit bb2d0f5a authored by chris's avatar chris
Browse files

initial service

parent ce6637aa
No related branches found
No related tags found
1 merge request!289Pm node views portals
import { injectable } from 'inversify';
import { Tools } from 'wax-prosemirror-services';
@injectable()
class MultipleChoiceQuestion extends Tools {
title = 'Change to Multiple Choice';
label = 'Multiple Choice';
name = 'Multiple Choice';
get run() {
return (state, dispatch) => {};
}
get active() {
return state => {};
}
select = (state, activeViewId) => {
return true;
};
get enable() {
return state => {};
}
}
export default MultipleChoiceQuestion;
import { Service } from 'wax-prosemirror-services';
import MultipleChoiceQuestion from './MultipleChoiceQuestion';
class MultipleChoiceQuestionService extends Service {
boot() {}
register() {
this.container.bind('MultipleChoiceQuestion').to(MultipleChoiceQuestion);
const createNode = this.container.get('CreateNode');
console.log(createNode);
}
}
export default MultipleChoiceQuestionService;
...@@ -49,6 +49,10 @@ import { DefaultSchema } from 'wax-prosemirror-utilities'; ...@@ -49,6 +49,10 @@ import { DefaultSchema } from 'wax-prosemirror-utilities';
import { WaxSelectionPlugin } from 'wax-prosemirror-plugins'; import { WaxSelectionPlugin } from 'wax-prosemirror-plugins';
/* Test Question Service*/
import MultipleChoiceQuestionService from '../MultipleChoiceQuestionService/MultipleChoiceQuestionService';
import invisibles, { import invisibles, {
space, space,
hardBreak, hardBreak,
...@@ -152,6 +156,7 @@ export default { ...@@ -152,6 +156,7 @@ export default {
}, },
services: [ services: [
new MultipleChoiceQuestionService(),
new CustomTagService(), new CustomTagService(),
new DisplayBlockLevelService(), new DisplayBlockLevelService(),
new DisplayToolGroupService(), new DisplayToolGroupService(),
......
...@@ -9,7 +9,7 @@ export { default as SchemaService } from './src/SchemaService/SchemaService'; ...@@ -9,7 +9,7 @@ export { default as SchemaService } from './src/SchemaService/SchemaService';
export { default as ShortCutsService } from './src/ShortCutsService/ShortCutsService'; export { default as ShortCutsService } from './src/ShortCutsService/ShortCutsService';
export { default as Tool } from './src/lib/Tools'; export { default as Tools } from './src/lib/Tools';
/* /*
All Elements services All Elements services
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment