Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable link-paste-handler in agendapoints and regulatory statements #450

Merged
merged 3 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 46 additions & 47 deletions app/controllers/agendapoints/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import { roadsign_regulation } from '@lblod/ember-rdfa-editor-lblod-plugins/plug
import { link, linkView } from '@lblod/ember-rdfa-editor/plugins/link';
import { highlight } from '@lblod/ember-rdfa-editor/plugins/highlight/marks/highlight';
import { color } from '@lblod/ember-rdfa-editor/plugins/color/marks/color';

import { linkPasteHandler } from '@lblod/ember-rdfa-editor/plugins/link';
export default class AgendapointsEditController extends Controller {
@service store;
@service router;
Expand All @@ -83,52 +83,50 @@ export default class AgendapointsEditController extends Controller {
@service features;
@tracked citationPlugin = citationPlugin(this.config.citation);

get schema() {
return new Schema({
nodes: {
doc,
paragraph,
repaired_block,
list_item,
ordered_list,
bullet_list,
placeholder,
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
date: date({
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
}),
STRUCTURE_NODES,
regulatoryStatementNode,
variable,
...besluitNodes,
roadsign_regulation,
heading,
blockquote,
horizontal_rule,
code_block,
text,
image,
hard_break,
invisible_rdfa,
block_rdfa,
link: link(this.config.link),
},
marks: {
inline_rdfa,
em,
strong,
underline,
strikethrough,
subscript,
superscript,
highlight,
color,
},
});
}
schema = new Schema({
nodes: {
doc,
paragraph,
repaired_block,
list_item,
ordered_list,
bullet_list,
placeholder,
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
date: date({
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
}),
STRUCTURE_NODES,
regulatoryStatementNode,
variable,
...besluitNodes,
roadsign_regulation,
heading,
blockquote,
horizontal_rule,
code_block,
text,
image,
hard_break,
invisible_rdfa,
block_rdfa,
link: link(this.config.link),
},
marks: {
inline_rdfa,
em,
strong,
underline,
strikethrough,
subscript,
superscript,
highlight,
color,
},
});

get config() {
return {
Expand Down Expand Up @@ -188,6 +186,7 @@ export default class AgendapointsEditController extends Controller {
shouldShowInvisibles: false,
}
),
linkPasteHandler(this.schema.nodes.link),
];
}

Expand Down
91 changes: 46 additions & 45 deletions app/controllers/regulatory-statements/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ import {

import { highlight } from '@lblod/ember-rdfa-editor/plugins/highlight/marks/highlight';
import { color } from '@lblod/ember-rdfa-editor/plugins/color/marks/color';
import { linkPasteHandler } from '@lblod/ember-rdfa-editor/plugins/link';

export default class RegulatoryStatementsRoute extends Controller {
@service documentService;
@service store;
Expand All @@ -77,52 +79,50 @@ export default class RegulatoryStatementsRoute extends Controller {
editor;
@tracked citationPlugin = citationPlugin(this.config.citation);

get schema() {
return new Schema({
nodes: {
doc: {
content: 'table_of_contents? ((chapter|block)+|(title|block)+)',
},
paragraph,
table_of_contents: table_of_contents(this.config.tableOfContents),
repaired_block,
list_item,
ordered_list,
bullet_list,
placeholder,
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
date: date({
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
}),
variable,
...STRUCTURE_NODES,
heading,
blockquote,
horizontal_rule,
code_block,
text,
image,
hard_break,
invisible_rdfa,
block_rdfa,
link: link(this.config.link),
schema = new Schema({
nodes: {
doc: {
content: 'table_of_contents? ((chapter|block)+|(title|block)+)',
},
marks: {
inline_rdfa,
em,
strong,
underline,
strikethrough,
subscript,
superscript,
highlight,
color,
},
});
}
paragraph,
table_of_contents: table_of_contents(this.config.tableOfContents),
repaired_block,
list_item,
ordered_list,
bullet_list,
placeholder,
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
date: date({
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
}),
variable,
...STRUCTURE_NODES,
heading,
blockquote,
horizontal_rule,
code_block,
text,
image,
hard_break,
invisible_rdfa,
block_rdfa,
link: link(this.config.link),
},
marks: {
inline_rdfa,
em,
strong,
underline,
strikethrough,
subscript,
superscript,
highlight,
color,
},
});

get nodeViews() {
return (controller) => {
Expand All @@ -148,6 +148,7 @@ export default class RegulatoryStatementsRoute extends Controller {
shouldShowInvisibles: false,
}
),
linkPasteHandler(this.schema.nodes.link),
];
}

Expand Down