mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
Math symbols: Remove 'tex' when identical to 'insert'
Change-Id: I3e9abc923eb686a60b9ae5359d8b823acc863f31
This commit is contained in:
parent
d9ac1fad43
commit
75db3ed9fe
File diff suppressed because it is too large
Load diff
|
@ -56,8 +56,9 @@
|
|||
|
||||
function makeRequest( symbol ) {
|
||||
var request,
|
||||
tex = symbol.tex || symbol.insert,
|
||||
data = querystring.stringify( {
|
||||
q: symbol.tex
|
||||
q: tex
|
||||
} ),
|
||||
// API call to mathoid
|
||||
options = {
|
||||
|
@ -81,12 +82,12 @@
|
|||
|
||||
res.on( 'end', function () {
|
||||
var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset,
|
||||
className = texToClass( symbol.tex ),
|
||||
className = texToClass( tex ),
|
||||
data = JSON.parse( body ),
|
||||
svg = data.svg;
|
||||
|
||||
if ( !svg ) {
|
||||
console.log( symbol.tex + ' FAILED: ' + body );
|
||||
console.log( tex + ' FAILED: ' + body );
|
||||
onEnd();
|
||||
return;
|
||||
}
|
||||
|
@ -109,11 +110,11 @@
|
|||
cssRule += '\tbackground-position: 50% ' + offset + '%;\n' +
|
||||
'}';
|
||||
cssRules.push( cssRule );
|
||||
console.log( symbol.tex + ' -> ' + className );
|
||||
console.log( tex + ' -> ' + className );
|
||||
} else {
|
||||
cssRule += '}';
|
||||
cssRules.push( cssRule );
|
||||
console.log( symbol.tex + ' -> ' + className );
|
||||
console.log( tex + ' -> ' + className );
|
||||
}
|
||||
onEnd();
|
||||
|
||||
|
@ -178,7 +179,7 @@
|
|||
if ( symbol.duplicate || symbol.notWorking ) {
|
||||
continue;
|
||||
}
|
||||
currentClassName = texToClass( symbol.tex );
|
||||
currentClassName = texToClass( symbol.tex || symbol.insert );
|
||||
alignBaseline = !symbol.alignBaseline;
|
||||
// If symbol is not in the old CSS file, or its alignBaseline status has changed,
|
||||
// add it to symbolList. Check to make sure it hasn't already been added.
|
||||
|
|
Loading…
Reference in a new issue