Isarra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/325888 )
Change subject: Style custom edit forms a bit ...................................................................... Style custom edit forms a bit Doesn't style around the js tools, biut this layout should act as a fallback either way. Also does some magic to use the hub colour, if it's a hub, for the borders. Put back @default. Bug: T149031 Bug: T148943 Change-Id: I1593f6dc199e0f0f639c891436429443a6d1519d --- M extension.json M includes/CollaborationHubContentEditor.php M includes/CollaborationListContentEditor.php A modules/ext.CollaborationKit.edit.styles.less M modules/ext.CollaborationKit.mixins.less 5 files changed, 119 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/88/325888/1 diff --git a/extension.json b/extension.json index ea49f1f..1396ad9 100644 --- a/extension.json +++ b/extension.json @@ -89,6 +89,9 @@ "ext.CollaborationKit.list.styles": { "styles": "ext.CollaborationKit.list.styles.less" }, + "zzext.CollaborationKit.edit.styles": { + "styles": "ext.CollaborationKit.edit.styles.less" + }, "ext.CollaborationKit.iconbrowser.styles": { "styles": "ext.CollaborationKit.iconbrowser.styles.less" }, diff --git a/includes/CollaborationHubContentEditor.php b/includes/CollaborationHubContentEditor.php index 66c7df9..f80de23 100644 --- a/includes/CollaborationHubContentEditor.php +++ b/includes/CollaborationHubContentEditor.php @@ -4,6 +4,9 @@ */ class CollaborationHubContentEditor extends EditPage { + /** @var string */ + protected $colour; + function __construct( $page ) { parent::__construct( $page ); // Make human readable the default format for editing, but still @@ -14,6 +17,7 @@ $out = $this->getContext()->getOutput(); $out->addModules( 'ext.CollaborationKit.colour' ); $out->addModules( 'ext.CollaborationKit.hubimage' ); + $out->addModuleStyles( 'zzext.CollaborationKit.edit.styles' ); $out->addModuleStyles( 'ext.CollaborationKit.colourbrowser.styles' ); $out->addJsConfigVars( 'wgCollaborationKitColourList', CollaborationHubContent::getThemeColours() ); } @@ -78,6 +82,8 @@ $colours ); + $this->colour = $selectedColour; + if ( $parts[5] == '' ) { $includedContent = ''; } else { @@ -110,7 +116,10 @@ $out = RequestContext::getMain()->getOutput(); - $out->addHtml( Html::rawElement( 'div', [ 'class' => 'mw-collabkit-modifiededitform' ], $this->getFormFields( $parts ) ) ); + $partFields = $this->getFormFields( $parts ); + $out->addHtml( Html::rawElement( 'div', [ 'class' => 'mw-collabkit-modifiededitform' ], $partFields ) ); + $out->prependHtml( Html::openElement( 'div', [ 'class' => 'mw-ck-theme-' . $this->colour ] ) ); + $out->addHtml( Html::closeElement( 'div' ) ); } /** diff --git a/includes/CollaborationListContentEditor.php b/includes/CollaborationListContentEditor.php index 50ccf1f..3ed0977 100644 --- a/includes/CollaborationListContentEditor.php +++ b/includes/CollaborationListContentEditor.php @@ -11,6 +11,9 @@ if ( $this->getCurrentContent()->isValid() ) { $this->contentFormat = CollaborationListContentHandler::FORMAT_WIKI; } + + $out = $this->getContext()->getOutput(); + $out->addModuleStyles( 'zzext.CollaborationKit.edit.styles' ); } protected function showContentForm() { diff --git a/modules/ext.CollaborationKit.edit.styles.less b/modules/ext.CollaborationKit.edit.styles.less new file mode 100644 index 0000000..3e7c207 --- /dev/null +++ b/modules/ext.CollaborationKit.edit.styles.less @@ -0,0 +1,101 @@ +@import "ext.CollaborationKit.mixins.less"; + +.ck-customeditor-toolbars( @default ); + +.mw-collabkit-modifiededitform > div { + margin-top: .5em; +} +.mw-collabkit-modifiededitform label { + font-weight: bold; +} + +.mw-ck-displayinput label:after, +.mw-ck-hubimageinput label:after, +.mw-ck-colourinput label:after { + content: ':'; + padding-right: .5em; +} +.mw-ck-displayinput, +.mw-ck-hubimageinput { + input { + width: 40%; + } +} + +.ck-customeditor-toolbars( @color ) { + .mw-collabkit-modifiededitform { + padding-bottom: .75em; + border-bottom: solid 4px @color; + } + #toolbar { + margin-bottom: .75em; + border-bottom: solid 3px @color; + } +} + +.mw-ck-theme-red1 { + .ck-customeditor-toolbars( @red1 ); +} +.mw-ck-theme-red2 { + .ck-customeditor-toolbars( @red2 ); +} +.mw-ck-theme-grey1 { + .ck-customeditor-toolbars( @grey1 ); +} +.mw-ck-theme-grey2 { + .ck-customeditor-toolbars( @grey2 ); +} +.mw-ck-theme-blue1 { + .ck-customeditor-toolbars( @blue1 ); +} +.mw-ck-theme-blue2 { + .ck-customeditor-toolbars( @blue2 ); +} +.mw-ck-theme-blue3 { + .ck-customeditor-toolbars( @blue3 ); +} +.mw-ck-theme-blue4 { + .ck-customeditor-toolbars( @blue4 ); +} +.mw-ck-theme-blue5 { + .ck-customeditor-toolbars( @blue5 ); +} +.mw-ck-theme-blue6 { + .ck-customeditor-toolbars( @blue6 ); +} +.mw-ck-theme-purple1 { + .ck-customeditor-toolbars( @purple1 ); +} +.mw-ck-theme-purple2 { + .ck-customeditor-toolbars( @purple2 ); +} +.mw-ck-theme-purple3 { + .ck-customeditor-toolbars( @purple3 ); +} +.mw-ck-theme-purple4 { + .ck-customeditor-toolbars( @purple4 ); +} +.mw-ck-theme-purple5 { + .ck-customeditor-toolbars( @purple5 ); +} +.mw-ck-theme-yellow1 { + .ck-customeditor-toolbars( @yellow1 ); +} +.mw-ck-theme-yellow2 { + .ck-customeditor-toolbars( @yellow2 ); +} +.mw-ck-theme-yellow3 { + .ck-customeditor-toolbars( @yellow3 ); +} +.mw-ck-theme-yellow4 { + .ck-customeditor-toolbars( @yellow4 ); +} +.mw-ck-theme-green1 { + .ck-customeditor-toolbars( @green1 ); +} +.mw-ck-theme-green2 { + .ck-customeditor-toolbars( @green2 ); +} +.mw-ck-theme-green3 { + .ck-customeditor-toolbars( @green3 ); +} diff --git a/modules/ext.CollaborationKit.mixins.less b/modules/ext.CollaborationKit.mixins.less index 4562093..4506eb5 100644 --- a/modules/ext.CollaborationKit.mixins.less +++ b/modules/ext.CollaborationKit.mixins.less @@ -82,3 +82,5 @@ @green1: #051; @green2: #af5; @green3: #663; + +@default: @grey2; -- To view, visit https://gerrit.wikimedia.org/r/325888 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1593f6dc199e0f0f639c891436429443a6d1519d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Isarra <zhoris...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits