mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Blacklist/convert tables and headings in VE target
Change-Id: I5e58fb1da1cb793bad5fb9640ef2dbf14c96d082
This commit is contained in:
parent
2fcc23ae61
commit
97cf4e8440
|
@ -42,9 +42,30 @@ CommentTarget.static.toolbarGroups = [
|
|||
// Mention?
|
||||
];
|
||||
|
||||
// Allow pasting links
|
||||
CommentTarget.static.importRules = ve.copy( CommentTarget.static.importRules );
|
||||
CommentTarget.static.importRules.external.blacklist[ 'link/mwExternal' ] = false;
|
||||
|
||||
CommentTarget.static.importRules.external.conversions = ve.extendObject(
|
||||
{},
|
||||
CommentTarget.static.importRules.external.conversions,
|
||||
{
|
||||
mwHeading: 'paragraph'
|
||||
}
|
||||
);
|
||||
|
||||
CommentTarget.static.importRules.external.blacklist = ve.extendObject(
|
||||
{},
|
||||
CommentTarget.static.importRules.external.blacklist,
|
||||
{
|
||||
// Annotations
|
||||
// Allow pasting external links
|
||||
'link/mwExternal': false,
|
||||
// Strip all table structure
|
||||
mwTable: true,
|
||||
tableSection: true,
|
||||
tableRow: true,
|
||||
tableCell: true
|
||||
}
|
||||
);
|
||||
|
||||
// TODO Add edit switcher actionGroup
|
||||
|
||||
|
|
|
@ -9,9 +9,21 @@ var CommentTarget = require( './CommentTarget.js' );
|
|||
* @constructor
|
||||
* @param {Object} [config] Configuration options
|
||||
*/
|
||||
function CommentTargetWidget() {
|
||||
function CommentTargetWidget( config ) {
|
||||
config = $.extend( {}, {
|
||||
excludeCommands: [
|
||||
'heading1',
|
||||
'heading2',
|
||||
'heading3',
|
||||
'heading4',
|
||||
'heading5',
|
||||
'heading6',
|
||||
'insertTable'
|
||||
]
|
||||
}, config );
|
||||
|
||||
// Parent constructor
|
||||
CommentTargetWidget.super.apply( this, arguments );
|
||||
CommentTargetWidget.super.call( this, config );
|
||||
|
||||
// Initialization
|
||||
this.$element.addClass( 'dt-ui-targetWidget' );
|
||||
|
|
Loading…
Reference in a new issue