Skip to content

Commit

Permalink
Add some of Stephanie's new colors
Browse files Browse the repository at this point in the history
Test Plan: Tested locally

Reviewers: stephanie

Reviewed By: stephanie

Differential Revision: http://phabricator.khanacademy.org/D908
  • Loading branch information
beneater committed Nov 9, 2012
1 parent d3fef15 commit 0e45811
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 6,038 deletions.
156 changes: 78 additions & 78 deletions build/kathjax-config.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
MathJax.Hub.Config({
messageStyle: "none",
skipStartupTypeset: true,
jax: ["input/TeX","output/HTML-CSS"],
extensions: ["tex2jax.js","MathZoom.js"],
TeX: {
extensions: [
"AMSmath.js",
"AMSsymbols.js",
"noErrors.js",
"noUndefined.js",
"newcommand.js",
"boldsymbol.js"
],
Macros: {
RR: "\\mathbb{R}",
blue: "\\color{#6495ED}",
orange: "\\color{#FFA500}",
pink: "\\color{#FF00AF}",
red: "\\color{red}",
green: "\\color{#28AE7B}",
gray: "\\color{gray}",
purple: "\\color{purple}"
},
Augment: {
Definitions: {
macros: {
lrsplit: "LRSplit",
cancel: "Cancel",
lcm: ["NamedOp", 0]
}
},
Parse: {
prototype: {
LRSplit: function( name ) {
var num = this.GetArgument( name ),
den = this.GetArgument( name );
var frac = MathJax.ElementJax.mml.mfrac( MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{'+num+'\\qquad}', this.stack.env ).mml(),
MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{\\qquad '+den+'}', this.stack.env ).mml() );
frac.numalign = MathJax.ElementJax.mml.ALIGN.LEFT;
frac.denomalign = MathJax.ElementJax.mml.ALIGN.RIGHT;
frac.linethickness = "0em";
this.Push( frac );
},
Cancel: function( name ) {
this.Push( MathJax.ElementJax.mml.menclose( this.ParseArg( name ) ).With({ notation: MathJax.ElementJax.mml.NOTATION.UPDIAGONALSTRIKE }) );
}
}
}
}
},
"HTML-CSS": {
scale: 100,
showMathMenu: false,
availableFonts: [ "TeX" ],
imageFont: null
}
messageStyle: "none",
skipStartupTypeset: true,
jax: ["input/TeX","output/HTML-CSS"],
extensions: ["tex2jax.js","MathZoom.js"],
TeX: {
extensions: [
"AMSmath.js",
"AMSsymbols.js",
"noErrors.js",
"noUndefined.js",
"newcommand.js",
"boldsymbol.js"
],
Macros: {
RR: "\\mathbb{R}",
blue: "\\color{#6495ED}",
orange: "\\color{#FFA500}",
pink: "\\color{#FF00AF}",
red: "\\color{#DF0030}",
green: "\\color{#28AE7B}",
gray: "\\color{gray}",
purple: "\\color{#9D38BD}"
},
Augment: {
Definitions: {
macros: {
lrsplit: "LRSplit",
cancel: "Cancel",
lcm: ["NamedOp", 0]
}
},
Parse: {
prototype: {
LRSplit: function( name ) {
var num = this.GetArgument( name ),
den = this.GetArgument( name );
var frac = MathJax.ElementJax.mml.mfrac( MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{'+num+'\\qquad}', this.stack.env ).mml(),
MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{\\qquad '+den+'}', this.stack.env ).mml() );
frac.numalign = MathJax.ElementJax.mml.ALIGN.LEFT;
frac.denomalign = MathJax.ElementJax.mml.ALIGN.RIGHT;
frac.linethickness = "0em";
this.Push( frac );
},
Cancel: function( name ) {
this.Push( MathJax.ElementJax.mml.menclose( this.ParseArg( name ) ).With({ notation: MathJax.ElementJax.mml.NOTATION.UPDIAGONALSTRIKE }) );
}
}
}
}
},
"HTML-CSS": {
scale: 100,
showMathMenu: false,
availableFonts: [ "TeX" ],
imageFont: null
}
});

// We don't want to use inline script elements, we want to use code blocks
MathJax.Hub.elementScripts = function( elem ) {
return elem.nodeName.toLowerCase() === "code" ?
[ elem ] :
elem.getElementsByTagName( "code" );
return elem.nodeName.toLowerCase() === "code" ?
[ elem ] :
elem.getElementsByTagName( "code" );
};

// Data is read in here:
Expand All @@ -71,33 +71,33 @@ MathJax.Hub.Browser.isKonqueror = true;

MathJax.Ajax.timeout = 60 * 1000;
MathJax.Ajax.loadError = (function( oldLoadError ) {
return function( file ) {
Khan.warnTimeout();
// Otherwise will receive unresponsive script error when finally finish loading
MathJax.Ajax.loadComplete = function( file ) { };
oldLoadError.call( this, file );
};
return function( file ) {
Khan.warnTimeout();
// Otherwise will receive unresponsive script error when finally finish loading
MathJax.Ajax.loadComplete = function( file ) { };
oldLoadError.call( this, file );
};
})( MathJax.Ajax.loadError );

MathJax.Hub.Register.StartupHook("HTML-CSS Jax - disable web fonts", function() {
Khan.warnFont();
Khan.warnFont();
});

// Trying to monkey-patch MathJax.Message.Init to not throw errors
MathJax.Message.Init = (function( oldInit ) {
return function( styles ) {
if ( this.div && this.div.parentNode == null ) {
var div = document.getElementById("MathJax_Message");
if ( div && div.firstChild == null ) {
var parent = div.parentNode;
if ( parent ) {
parent.removeChild( div );
}
}
}
return function( styles ) {
if ( this.div && this.div.parentNode == null ) {
var div = document.getElementById("MathJax_Message");
if ( div && div.firstChild == null ) {
var parent = div.parentNode;
if ( parent ) {
parent.removeChild( div );
}
}
}

oldInit.call( this, styles );
};
oldInit.call( this, styles );
};
})( MathJax.Message.Init );

MathJax.Hub.Startup.onload();
2 changes: 1 addition & 1 deletion khan-exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ var Khan = (function() {

moduleDependencies: {
"math": [{
src: urlBase + "utils/MathJax/1.1a/MathJax.js?config=KAthJax-62e7a7b628ba168df6b9cd3de8feac38"
src: urlBase + "utils/MathJax/1.1a/MathJax.js?config=KAthJax-8a6b08f6f5c97d7c3c310cc909a7a140"
}, "raphael"],

// Load Raphael locally because IE8 has a problem with the 1.5.2 minified release
Expand Down
Loading

0 comments on commit 0e45811

Please sign in to comment.