| Index: java/org/chromium/distiller/webdocument/WebFigure.java
|
| diff --git a/java/org/chromium/distiller/webdocument/WebFigure.java b/java/org/chromium/distiller/webdocument/WebFigure.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9f565458b5631a029856901b8d5489e52d47c3b9
|
| --- /dev/null
|
| +++ b/java/org/chromium/distiller/webdocument/WebFigure.java
|
| @@ -0,0 +1,28 @@
|
| +package org.chromium.distiller.webdocument;
|
| +
|
| +import com.google.gwt.dom.client.Document;
|
| +import com.google.gwt.dom.client.Element;
|
| +
|
| +public class WebFigure extends WebImage {
|
| +
|
| + private String figCaption;
|
| +
|
| + public WebFigure(Element e, int w, int h, String src, String caption) {
|
| + super(e, w, h, src);
|
| + figCaption = caption;
|
| + }
|
| +
|
| + @Override
|
| + public String generateOutput(boolean textOnly) {
|
| + if (textOnly) return figCaption;
|
| +
|
| + Element fig = Document.get().createElement("FIGURE");
|
| + fig.setInnerHTML(super.generateOutput(false));
|
| + if (!figCaption.isEmpty()) {
|
| + Element cap = Document.get().createElement("FIGCAPTION");
|
| + cap.setInnerHTML(figCaption);
|
| + fig.appendChild(cap);
|
| + }
|
| + return fig.getString();
|
| + }
|
| +}
|
|
|