| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
ve.ce.NailedAnnotation = function VeCeNailedAnnotation() { |
| 15 |
|
| 16 |
this.contentFragment = document.createDocumentFragment(); |
| 17 |
|
| 18 |
this.$element.addClass( 've-ce-nailedAnnotation' ); |
| 19 |
}; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
OO.initClass( ve.ce.NailedAnnotation ); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
ve.ce.NailedAnnotation.static.canBeActive = true; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
ve.ce.NailedAnnotation.static.makeNail = function ( type ) { |
| 38 |
const nail = document.createElement( 'img' ); |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
if ( $.client.profile().layout === 'gecko' || ve.inputDebug ) { |
| 44 |
nail.src = ve.inputDebug ? ve.ce.nailImgDataUri : ve.ce.minImgDataUri; |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
nail.className = 've-ce-nail ve-ce-nail-' + type + ( ve.inputDebug ? ' ve-ce-nail-debug' : '' ); |
| 52 |
return nail; |
| 53 |
}; |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
ve.ce.NailedAnnotation.prototype.getContentContainer = function () { |
| 62 |
return this.contentFragment; |
| 63 |
}; |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
ve.ce.NailedAnnotation.prototype.attachContents = function () { |
| 69 |
const element = this.$element[ 0 ]; |
| 70 |
|
| 71 |
element.appendChild( this.constructor.static.makeNail( 'post-open' ) ); |
| 72 |
element.appendChild( this.contentFragment ); |
| 73 |
element.appendChild( this.constructor.static.makeNail( 'pre-close' ) ); |
| 74 |
}; |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
ve.ce.NailedAnnotation.prototype.appendTo = function ( node ) { |
| 81 |
|
| 82 |
node.appendChild( this.constructor.static.makeNail( 'pre-open' ) ); |
| 83 |
node.appendChild( this.$element[ 0 ] ); |
| 84 |
node.appendChild( this.constructor.static.makeNail( 'post-close' ) ); |
| 85 |
}; |