| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.dm.MWGalleryCaptionNode = function VeDmMWGalleryCaptionNode() { |
| 19 |
|
| 20 |
ve.dm.MWGalleryCaptionNode.super.apply( this, arguments ); |
| 21 |
}; |
| 22 |
|
| 23 |
OO.inheritClass( ve.dm.MWGalleryCaptionNode, ve.dm.BranchNode ); |
| 24 |
|
| 25 |
ve.dm.MWGalleryCaptionNode.static.name = 'mwGalleryCaption'; |
| 26 |
|
| 27 |
ve.dm.MWGalleryCaptionNode.static.matchTagNames = [ 'li' ]; |
| 28 |
|
| 29 |
ve.dm.MWGalleryCaptionNode.static.matchFunction = function ( element ) { |
| 30 |
const parentTypeof = ( element.parentNode && element.parentNode.getAttribute( 'typeof' ) ) || ''; |
| 31 |
return element.getAttribute( 'class' ) === 'gallerycaption' && |
| 32 |
parentTypeof.trim().split( /\s+/ ).indexOf( 'mw:Extension/gallery' ) !== -1; |
| 33 |
}; |
| 34 |
|
| 35 |
ve.dm.MWGalleryCaptionNode.static.parentNodeTypes = [ 'mwGallery' ]; |
| 36 |
|
| 37 |
ve.dm.MWGalleryCaptionNode.static.toDomElements = function ( dataElement, doc ) { |
| 38 |
const li = doc.createElement( 'li' ); |
| 39 |
li.classList.add( 'gallerycaption' ); |
| 40 |
return [ li ]; |
| 41 |
}; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
ve.dm.modelRegistry.register( ve.dm.MWGalleryCaptionNode ); |