Math symbols: Remove 'tex' when identical to 'insert'

Change-Id: I3e9abc923eb686a60b9ae5359d8b823acc863f31
This commit is contained in:
Ed Sanders 2017-02-09 19:15:43 +00:00
parent d9ac1fad43
commit 75db3ed9fe
2 changed files with 454 additions and 981 deletions

File diff suppressed because it is too large Load Diff

View File

@ -56,8 +56,9 @@
function makeRequest( symbol ) { function makeRequest( symbol ) {
var request, var request,
tex = symbol.tex || symbol.insert,
data = querystring.stringify( { data = querystring.stringify( {
q: symbol.tex q: tex
} ), } ),
// API call to mathoid // API call to mathoid
options = { options = {
@ -81,12 +82,12 @@
res.on( 'end', function () { res.on( 'end', function () {
var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset, var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset,
className = texToClass( symbol.tex ), className = texToClass( tex ),
data = JSON.parse( body ), data = JSON.parse( body ),
svg = data.svg; svg = data.svg;
if ( !svg ) { if ( !svg ) {
console.log( symbol.tex + ' FAILED: ' + body ); console.log( tex + ' FAILED: ' + body );
onEnd(); onEnd();
return; return;
} }
@ -109,11 +110,11 @@
cssRule += '\tbackground-position: 50% ' + offset + '%;\n' + cssRule += '\tbackground-position: 50% ' + offset + '%;\n' +
'}'; '}';
cssRules.push( cssRule ); cssRules.push( cssRule );
console.log( symbol.tex + ' -> ' + className ); console.log( tex + ' -> ' + className );
} else { } else {
cssRule += '}'; cssRule += '}';
cssRules.push( cssRule ); cssRules.push( cssRule );
console.log( symbol.tex + ' -> ' + className ); console.log( tex + ' -> ' + className );
} }
onEnd(); onEnd();
@ -178,7 +179,7 @@
if ( symbol.duplicate || symbol.notWorking ) { if ( symbol.duplicate || symbol.notWorking ) {
continue; continue;
} }
currentClassName = texToClass( symbol.tex ); currentClassName = texToClass( symbol.tex || symbol.insert );
alignBaseline = !symbol.alignBaseline; alignBaseline = !symbol.alignBaseline;
// If symbol is not in the old CSS file, or its alignBaseline status has changed, // 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. // add it to symbolList. Check to make sure it hasn't already been added.