Index: ui/equation/imagerenderer.js
===================================================================
--- ui/equation/imagerenderer.js (revision 2021)
+++ ui/equation/imagerenderer.js (working copy)
@@ -104,7 +104,7 @@
if (!equation) {
return '';
}
-
+/*
var url = goog.ui.equation.ImageRenderer.SERVER_NAME_ +
'/chart?cht=tx' +
'&chf=bg,s,' +
@@ -113,6 +113,10 @@
goog.ui.equation.ImageRenderer.FOREGROUND_COLOR +
'&chl=' +
encodeURIComponent(equation);
+*/
+ var url = 'http://latex.codecogs.com/gif.latex?' +
+ encodeURIComponent(equation);
+
return url;
};
@@ -123,7 +127,8 @@
* @return {string?} The equation string, null if imageUrl cannot be parsed.
*/
goog.ui.equation.ImageRenderer.getEquationFromImageUrl = function(imageUrl) {
- return goog.uri.utils.getParamValue(imageUrl, 'chl');
+// return goog.uri.utils.getParamValue(imageUrl, 'chl');
+ return decodeURIComponent(goog.uri.utils.getQueryData(imageUrl));
};
Index: ui/editor/defaulttoolbar.js
===================================================================
--- ui/editor/defaulttoolbar.js (revision 2021)
+++ ui/editor/defaulttoolbar.js (working copy)
@@ -797,6 +797,10 @@
goog.ui.editor.DefaultToolbar.MSG_IMAGE_TITLE = goog.getMsg('Insert image');
+/** @desc Insert image button tooltip. */
+goog.ui.editor.DefaultToolbar.MSG_EQUATION_TITLE = goog.getMsg('Insert equation');
+
+
/** @desc Strike through button tooltip. */
goog.ui.editor.DefaultToolbar.MSG_STRIKE_THROUGH_TITLE =
goog.getMsg('Strikethrough');
@@ -1000,6 +1004,11 @@
classes: goog.getCssName('tr-icon') + ' ' + goog.getCssName('tr-image'),
factory: goog.ui.editor.ToolbarFactory.makeButton
}, {
+ command: goog.editor.Command.EQUATION,
+ tooltip: goog.ui.editor.DefaultToolbar.MSG_EQUATION_TITLE,
+ classes: goog.getCssName('tr-icon') + ' ' + goog.getCssName('tr-equation'),
+ factory: goog.ui.editor.ToolbarFactory.makeButton
+}, {
command: goog.editor.Command.STRIKE_THROUGH,
tooltip: goog.ui.editor.DefaultToolbar.MSG_STRIKE_THROUGH_TITLE,
classes: goog.getCssName('tr-icon') + ' ' +
Index: demos/editor/editor.html
===================================================================
--- demos/editor/editor.html (revision 2021)
+++ demos/editor/editor.html (working copy)
@@ -27,6 +27,8 @@
goog.require('goog.editor.plugins.UndoRedo');
goog.require('goog.ui.editor.DefaultToolbar');
goog.require('goog.ui.editor.ToolbarController');
+ goog.require('goog.editor.plugins.EquationEditorPlugin');
+ goog.require('goog.editor.plugins.equation.EquationBubble');
@@ -49,6 +51,8 @@
+
+