mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
feat(core): add config var 'wgCitizenTableNowrapClasses' (#621)
* add config var 'wgCitizenTableNowrapClasses' * refactor: load config via require
This commit is contained in:
parent
0fb2738d96
commit
a7b99d11f0
|
@ -112,6 +112,7 @@ Name | Description | Values | Default
|
|||
`$wgCitizenThemeColor` | The color defined in the `theme-color` meta tag | Hex color code | `#131a21`
|
||||
`$wgCitizenEnableCJKFonts` | Enable included Noto Sans CJK for wikis that serves CJK languages | `true` - enable; `false` - disable | `false`
|
||||
`$wgCitizenEnablePreferences` | Enable the preferences menu | `true` - enable; `false` - disable | `true`
|
||||
`$wgCitizenTableNowrapClasses` | Defines table css classes ignored by citizen table wrapper | List of css classes. Extend with `$wgCitizenTableNowrapClasses[] = 'my_class';` | `["citizen-table-nowrap", "mw-changeslist-line", "infobox", "cargoDynamicTable", "dataTable"]`
|
||||
|
||||
### Search suggestions
|
||||
Name | Description | Values | Default
|
||||
|
|
|
@ -47,6 +47,7 @@ class ResourceLoaderHooks {
|
|||
return [
|
||||
'wgCitizenEnablePreferences' => $config->get( 'CitizenEnablePreferences' ),
|
||||
'wgCitizenSearchModule' => $config->get( 'CitizenSearchModule' ),
|
||||
'wgCitizenTableNowrapClasses' => $config->get( 'CitizenTableNowrapClasses' ),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
const config = require( './config.json' );
|
||||
|
||||
/**
|
||||
* Set up scroll affordance for an overflowed element
|
||||
* TODO: Move this out of tables when this is used by more stuff
|
||||
|
@ -60,16 +62,8 @@ function setupOverflowState( element ) {
|
|||
* @return {void}
|
||||
*/
|
||||
function wrapTable( table ) {
|
||||
// TODO: Make this a config flag
|
||||
const ignoredClasses = [
|
||||
'citizen-table-nowrap',
|
||||
'mw-changeslist-line',
|
||||
'infobox',
|
||||
// Extension:Cargo
|
||||
// dataTable from Extension:Cargo and some other has issue with the wrapper
|
||||
'cargoDynamicTable',
|
||||
'dataTable'
|
||||
];
|
||||
// Load ignored classes from config
|
||||
const ignoredClasses = config.wgCitizenTableNowrapClasses;
|
||||
|
||||
// Check table and parent for ignored classes
|
||||
const hasIgnoredClass = ( ignoreClass ) => {
|
||||
|
|
12
skin.json
12
skin.json
|
@ -604,6 +604,18 @@
|
|||
"description": "Enables or disable preferences module",
|
||||
"descriptionmsg": "citizen-config-enablepreferences",
|
||||
"public": true
|
||||
},
|
||||
"TableNowrapClasses": {
|
||||
"value": [
|
||||
"citizen-table-nowrap",
|
||||
"mw-changeslist-line",
|
||||
"infobox",
|
||||
"cargoDynamicTable",
|
||||
"dataTable"
|
||||
],
|
||||
"description": "Defines table css classes ignored by citizen table wrapper",
|
||||
"descriptionmsg": "citizen-config-tablenowrapclasses",
|
||||
"public": true
|
||||
}
|
||||
},
|
||||
"manifest_version": 2
|
||||
|
|
Loading…
Reference in a new issue