From 9e9a671fc1e78868d00e2ad17d67fe19036d693a Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 28 May 2014 18:35:07 -0700 Subject: [PATCH] Make images look better, account for e82629895b38 in MW core Prevent images from getting double borders due to slugs, and prevent extraneous margins from piling up in captions. Also add the ve-ce-mwBlockImageNode class which shockingly wasn't being set (only ve-ce-mwBlockImageNode-TYPE was set). Change-Id: I86b95aa0c0def92a9790b7cdb4b05837fb8f65e2 --- modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js | 2 +- .../ve-mw/ce/styles/nodes/ve.ce.MWBlockImageNode.css | 10 ++++++++++ .../ve-mw/ce/styles/nodes/ve.ce.MWInlineImageNode.css | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js index f03404b3ab..ab2cdfc6b3 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js @@ -48,7 +48,7 @@ ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode( model, config ) { this.$figure = this.$( '
' ) .appendTo( this.$element ) .append( this.$a ) - .addClass( 've-ce-mwBlockImageNode-type-' + type ) + .addClass( 've-ce-mwBlockImageNode ve-ce-mwBlockImageNode-type-' + type ) // 'typeof' should appear with the proper Parsoid-generated // type. The model deals with converting it .attr( 'typeof', this.typeToRdfa[ type ] ); diff --git a/modules/ve-mw/ce/styles/nodes/ve.ce.MWBlockImageNode.css b/modules/ve-mw/ce/styles/nodes/ve.ce.MWBlockImageNode.css index 3981683e29..6ee980ab68 100644 --- a/modules/ve-mw/ce/styles/nodes/ve.ce.MWBlockImageNode.css +++ b/modules/ve-mw/ce/styles/nodes/ve.ce.MWBlockImageNode.css @@ -10,3 +10,13 @@ figure[typeof~='mw:Image'].mw-halign-center + .ve-ce-protectedNode-shield { display: none; } + +/* Override border on shields for images */ +.ve-ce-mwBlockImageNode .ve-ce-protectedNode-shield { + border: none; +} + +/* Override paragraph margins inside of captions */ +.ve-ce-mwBlockImageNode figcaption p { + margin: 0 !important; +} \ No newline at end of file diff --git a/modules/ve-mw/ce/styles/nodes/ve.ce.MWInlineImageNode.css b/modules/ve-mw/ce/styles/nodes/ve.ce.MWInlineImageNode.css index 2bdf70f8ed..69b2d3f7a4 100644 --- a/modules/ve-mw/ce/styles/nodes/ve.ce.MWInlineImageNode.css +++ b/modules/ve-mw/ce/styles/nodes/ve.ce.MWInlineImageNode.css @@ -9,3 +9,7 @@ display: inline-block; } +/* Override border on shields for images */ +.ve-ce-mwInlineImageNode .ve-ce-protectedNode-shield { + border: none; +} \ No newline at end of file