Skip to content

Commit

Permalink
Use external OOUI theme repo instead of including (#286)
Browse files Browse the repository at this point in the history
* Use external OOUI theme repo instead of including

* Update CHANGELOG.md
  • Loading branch information
lens0021 authored Jul 21, 2021
1 parent 0b11ef9 commit 820dd45
Show file tree
Hide file tree
Showing 1,014 changed files with 730 additions and 43,767 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
DOCKER_REGISTRY: docker-registry.wikimedia.org
DOCKER_ORG: releng
QUIBBLE_DOCKER_IMAGE: quibble-stretch-php73
QUIBBLE_DOCKER_IMAGE: quibble-buster-php73
PHAN_DOCKER_IMAGE: mediawiki-phan-php73

jobs:
Expand Down
1 change: 1 addition & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<file>.</file>
<arg name="extensions" value="php,php5,inc" />
<arg name="encoding" value="UTF-8" />
<exclude-pattern type="relative">^includes/FemiwikiTheme.php*</exclude-pattern>
</ruleset>
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Versions and bullets are arranged chronologically from latest to oldest.

## Unreleased

- Installed OOUI theme repository via the package manager instead of including the source.

## v1.9.1

- Fixed a blue link on Special:Homepage. (https://github.com/femiwiki/FemiwikiSkin/issues/279)
Expand Down
18 changes: 10 additions & 8 deletions includes/FemiwikiTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@

class FemiwikiTheme extends Theme {

/**
*
* @param Element $element
* @return array Categorized class names with on and off lists
*/
/* Methods */

public function getElementClasses( Element $element ) {
$variants = [
'warning' => false,
'invert' => false,
'progressive' => false,
'destructive' => false
'destructive' => false,
'error' => false,
'warning' => false,
'success' => false
];

// Parent method
Expand All @@ -32,14 +31,17 @@ public function getElementClasses( Element $element ) {
if ( $isFramed && ( $isActive || $element->isDisabled() || $element->hasFlag( 'primary' ) ) ) {
// Button with a dark background, use white icon
$variants['invert'] = true;
} elseif ( !$isFramed && $element->isDisabled() ) {
} elseif ( !$isFramed && $element->isDisabled() && !$element->hasFlag( 'invert' ) ) {
// Frameless disabled button, always use black icon regardless of flags
$variants['invert'] = false;
} elseif ( !$element->isDisabled() ) {
// Any other kind of button, use the right colored icon if available
$variants['progressive'] = $element->hasFlag( 'progressive' );
$variants['destructive'] = $element->hasFlag( 'destructive' );
$variants['invert'] = $element->hasFlag( 'invert' );
$variants['error'] = $element->hasFlag( 'error' );
$variants['warning'] = $element->hasFlag( 'warning' );
$variants['success'] = $element->hasFlag( 'success' );
}
}

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
"lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
"fix": "prettier . --write"
},
"dependencies": {
"@femiwiki/ooui-femiwiki-theme": "https://github.com/femiwiki/OOUIFemiwikiTheme.git#REL1_36",
"xeicon": "^2.3.3"
},
"devDependencies": {
"@prettier/plugin-xml": "^0.13.1",
"@types/jquery": "^3.5.5",
"@types/node-fetch": "^2.5.10",
"grunt-banana-checker": "^0.9.0",
"prettier": "^2.3.0",
"typescript": "4.3.2"
},
"dependencies": {
"xeicon": "^2.3.3"
}
}
59 changes: 0 additions & 59 deletions resources/ooui/icons-accessibility.json

This file was deleted.

74 changes: 0 additions & 74 deletions resources/ooui/icons-alerts.json

This file was deleted.

134 changes: 0 additions & 134 deletions resources/ooui/icons-content.json

This file was deleted.

Loading

0 comments on commit 820dd45

Please sign in to comment.