Merge "Move paste rules to Target"

This commit is contained in:
jenkins-bot 2014-02-06 23:01:32 +00:00 committed by Gerrit Code Review
commit a814b61736
4 changed files with 17 additions and 18 deletions

View file

@ -134,19 +134,6 @@ OO.inheritClass( ve.init.mw.ViewPageTarget, ve.init.mw.Target );
/* Static Properties */
ve.init.mw.ViewPageTarget.static.pasteRules = {
'external': {
'blacklist': [
// Annotations
'link', 'textStyle/span', 'textStyle/underline',
// Nodes
'image', 'div', 'alienInline', 'alienBlock'
],
'removeHtmlAttributes': true
},
'all': null
};
/**
* Compatibility map used with jQuery.client to black-list incompatible browsers.
*

View file

@ -198,9 +198,21 @@ ve.init.mw.Target.static.toolbarGroups = [
'promote': [ 'reference', 'mediaInsert' ],
'demote': [ 'language', 'specialcharacter' ]
}
];
ve.init.mw.Target.static.pasteRules = {
'external': {
'blacklist': [
// Annotations
'link', 'textStyle/span', 'textStyle/underline',
// Nodes
'image', 'div', 'alienInline', 'alienBlock'
],
'removeHtmlAttributes': true
},
'all': null
};
/* Static Methods */
/**

View file

@ -92,11 +92,11 @@ ve.ui.MWMediaEditDialog.static.surfaceCommands = [
];
ve.ui.MWMediaEditDialog.static.pasteRules = ve.extendObject(
ve.copy( ve.init.mw.ViewPageTarget.static.pasteRules ),
ve.copy( ve.init.mw.Target.static.pasteRules ),
{
'all': {
'blacklist': OO.simpleArrayUnion(
ve.getProp( ve.init.mw.ViewPageTarget.static.pasteRules, 'all', 'blacklist' ) || [],
ve.getProp( ve.init.mw.Target.static.pasteRules, 'all', 'blacklist' ) || [],
[
// Tables (but not lists) are possible in wikitext with a leading
// line break but we prevent creating these with the UI

View file

@ -90,11 +90,11 @@ ve.ui.MWReferenceDialog.static.surfaceCommands = [
];
ve.ui.MWReferenceDialog.static.pasteRules = ve.extendObject(
ve.copy( ve.init.mw.ViewPageTarget.static.pasteRules ),
ve.copy( ve.init.mw.Target.static.pasteRules ),
{
'all': {
'blacklist': OO.simpleArrayUnion(
ve.getProp( ve.init.mw.ViewPageTarget.static.pasteRules, 'all', 'blacklist' ) || [],
ve.getProp( ve.init.mw.Target.static.pasteRules, 'all', 'blacklist' ) || [],
[
// Nested references are impossible
'mwReference', 'mwReferenceList',