mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-13 17:56:59 +00:00
Update mediawiki-codesniffer and parallel-lint settings
Fix remaining sniffer warnings and errors Change-Id: I2a2ab037793df771be2abc4a4433726469f60ab0
This commit is contained in:
parent
6c158a5d85
commit
9a07f022f9
|
@ -64,12 +64,12 @@ class MathHooks {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function mathModeToString( $mode, $default = 'png' ) {
|
public static function mathModeToString( $mode, $default = 'png' ) {
|
||||||
// The following deprecated modes have been removed:
|
// The following deprecated modes have been removed:
|
||||||
// 'MW_MATH_SIMPLE' => 1
|
// 'MW_MATH_SIMPLE' => 1
|
||||||
// 'MW_MATH_HTML' => 2
|
// 'MW_MATH_HTML' => 2
|
||||||
// 'MW_MATH_MODERN' => 4
|
// 'MW_MATH_MODERN' => 4
|
||||||
// 'MW_MATH_MATHJAX' => 6
|
// 'MW_MATH_MATHJAX' => 6
|
||||||
// 'MW_MATH_LATEXML_JAX' => 8
|
// 'MW_MATH_LATEXML_JAX' => 8
|
||||||
|
|
||||||
$defs = array(
|
$defs = array(
|
||||||
'MW_MATH_PNG' => 0,
|
'MW_MATH_PNG' => 0,
|
||||||
|
@ -365,7 +365,7 @@ class MathHooks {
|
||||||
public static function registerExtension() {
|
public static function registerExtension() {
|
||||||
global $wgDefaultUserOptions, $wgMathValidModes, $wgMathDisableTexFilter;
|
global $wgDefaultUserOptions, $wgMathValidModes, $wgMathDisableTexFilter;
|
||||||
$wgMathValidModes = MathRenderer::getValidModes();
|
$wgMathValidModes = MathRenderer::getValidModes();
|
||||||
if ( $wgMathDisableTexFilter == true ){ //ensure backwards compatibility
|
if ( $wgMathDisableTexFilter == true ) { // ensure backwards compatibility
|
||||||
$wgMathDisableTexFilter = 1;
|
$wgMathDisableTexFilter = 1;
|
||||||
}
|
}
|
||||||
$wgMathDisableTexFilter = MathRenderer::getDisableTexFilter();
|
$wgMathDisableTexFilter = MathRenderer::getDisableTexFilter();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"jakub-onderka/php-parallel-lint": "0.9.*",
|
"jakub-onderka/php-parallel-lint": "0.9",
|
||||||
"mediawiki/mediawiki-codesniffer": "0.3.0"
|
"mediawiki/mediawiki-codesniffer": "0.4.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": [
|
"test": [
|
||||||
"parallel-lint . --exclude vendor",
|
"parallel-lint . --exclude vendor",
|
||||||
"phpcs -p"
|
"phpcs -p -s"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,33 @@
|
||||||
/*
|
/*
|
||||||
Document : ext.math
|
* Document : ext.math
|
||||||
Created on : 23.09.2013, 13:55:00
|
* Created on : 23.09.2013, 13:55:00
|
||||||
Author : Physikerwelt (Moritz Schubotz)
|
* Author : Physikerwelt (Moritz Schubotz)
|
||||||
Description:
|
* Description: Shows browser-dependent math output.
|
||||||
Shows browser-dependent math output.
|
*/
|
||||||
*/
|
|
||||||
@namespace m url('http://www.w3.org/1998/Math/MathML');
|
@namespace m url('http://www.w3.org/1998/Math/MathML');
|
||||||
|
|
||||||
/* Default style for MathML. */
|
/* Default style for MathML. */
|
||||||
.mwe-math-mathml-inline { display: inline !important; }
|
.mwe-math-mathml-inline { display: inline !important; }
|
||||||
.mwe-math-mathml-display { display: block !important; margin-left: auto; margin-right: auto; }
|
.mwe-math-mathml-display { display: block !important; margin-left: auto; margin-right: auto; }
|
||||||
.mwe-math-mathml-a11y {
|
.mwe-math-mathml-a11y {
|
||||||
/* We try to hide the MathML formula in a way that still makes it accessible to accessibility tools. */
|
/* We try to hide the MathML formula in a way that still makes it accessible to accessibility tools. */
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
m|math {
|
m|math {
|
||||||
/* Try some popular OpenType MATH fonts before the WOFF fallback */
|
/* Try some popular OpenType MATH fonts before the WOFF fallback */
|
||||||
/* We put Cambria before Cambria Math to workaround a bug on Windows
|
/* We put Cambria before Cambria Math to workaround a bug on Windows
|
||||||
(see https://bugzilla.mozilla.org/show_bug.cgi?id=598900) */
|
(see https://bugzilla.mozilla.org/show_bug.cgi?id=598900) */
|
||||||
font-family: Cambria, Cambria Math, Latin Modern Math, STIX Math, LatinModernMathWOFF, serif;
|
font-family: Cambria, Cambria Math, Latin Modern Math, STIX Math, LatinModernMathWOFF, serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default style for the image fallback. */
|
/* Default style for the image fallback. */
|
||||||
/* Note: We had to use !important rules because of conflicts with the style
|
/* Note: We had to use !important rules because of conflicts with the style
|
||||||
generated by Mathoid. See https://gerrit.wikimedia.org/r/#/c/166213/ */
|
generated by Mathoid. See https://gerrit.wikimedia.org/r/#/c/166213/ */
|
||||||
.mwe-math-fallback-image-inline { display: inline-block; vertical-align: middle; }
|
.mwe-math-fallback-image-inline { display: inline-block; vertical-align: middle; }
|
||||||
.mwe-math-fallback-image-display { display: block; margin-left: auto !important; margin-right: auto !important; }
|
.mwe-math-fallback-image-display { display: block; margin-left: auto !important; margin-right: auto !important; }
|
||||||
|
|
||||||
|
@ -36,21 +35,22 @@ m|math {
|
||||||
.mwe-math-fallback-source-inline { display: inline; vertical-align: middle; }
|
.mwe-math-fallback-source-inline { display: inline; vertical-align: middle; }
|
||||||
.mwe-math-fallback-source-display { display: block; margin-left: auto; margin-right: auto; }
|
.mwe-math-fallback-source-display { display: block; margin-left: auto; margin-right: auto; }
|
||||||
|
|
||||||
/******************************************************************************/
|
/**
|
||||||
/* Browser-specific hacks are bad but let's use that for now...
|
* Browser-specific hacks are bad but let's use that for now...
|
||||||
See http://browserhacks.com/ */
|
* See http://browserhacks.com/
|
||||||
|
*/
|
||||||
@-moz-document url-prefix() {
|
@-moz-document url-prefix() {
|
||||||
/* For Gecko browsers, hide the SVG fallback and show the MathML instead.
|
/* For Gecko browsers, hide the SVG fallback and show the MathML instead.
|
||||||
We override the style for SVG and MathML above */
|
* We override the style for SVG and MathML above
|
||||||
.mwe-math-mathml-a11y {
|
*/
|
||||||
clip: auto;
|
.mwe-math-mathml-a11y {
|
||||||
overflow: visible;
|
clip: auto;
|
||||||
position: static;
|
overflow: visible;
|
||||||
width: auto;
|
position: static;
|
||||||
height: auto;
|
width: auto;
|
||||||
opacity: 1;
|
height: auto;
|
||||||
}
|
opacity: 1;
|
||||||
.mwe-math-mathml-inline + .mwe-math-fallback-image-inline,
|
}
|
||||||
.mwe-math-mathml-display + .mwe-math-fallback-image-display { display: none !important; }
|
.mwe-math-mathml-inline + .mwe-math-fallback-image-inline,
|
||||||
|
.mwe-math-mathml-display + .mwe-math-fallback-image-display { display: none !important; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
/*
|
/*
|
||||||
Document : ext.math.
|
* Document : ext.math.
|
||||||
Created on : 20.10.2014, 22:00:00
|
* Created on : 20.10.2014, 22:00:00
|
||||||
Author : fredw (Frédéric Wang)
|
* Author : fredw (Frédéric Wang)
|
||||||
Description:
|
* Description:
|
||||||
Additional style, to load only on desktop.
|
* Additional style, to load only on desktop.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
/* WOFF version of Latin Modern Math.
|
/* WOFF version of Latin Modern Math.
|
||||||
See https://github.com/fred-wang/MathFonts */
|
* See https://github.com/fred-wang/MathFonts
|
||||||
font-family: LatinModernMathWOFF;
|
*/
|
||||||
src: url(./LatinModern/latinmodern-math.woff);
|
font-family: LatinModernMathWOFF;
|
||||||
|
src: url(./LatinModern/latinmodern-math.woff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,3 @@
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<ruleset>
|
<ruleset>
|
||||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
|
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
|
||||||
<file>.</file>
|
<file>.</file>
|
||||||
<arg name="extensions" value="php"/>
|
<arg name="extensions" value="php,php5,inc"/>
|
||||||
|
<arg name="encoding" value="utf8"/>
|
||||||
<exclude-pattern>vendor</exclude-pattern>
|
<exclude-pattern>vendor</exclude-pattern>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|
Loading…
Reference in a new issue