mirror of
https://github.com/tbluemel/rtf.js.git
synced 2026-11-30 16:47:59 +01:00
Fix pictures in rtf demo
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@ function displayRtfFile(blob) {
|
||||
var settings = {
|
||||
onPicture: function(isLegacy, create) {
|
||||
// isLegacy is null if it's the only available picture (e.g. legacy rtf)
|
||||
if (isLegacy === legacyPictures) {
|
||||
if (isLegacy === null || isLegacy === legacyPictures) {
|
||||
var elem = $(create()).attr("class", "rtfpict"); // WHY does addClass not work on <svg>?!
|
||||
return setPictBorder(elem, showPicBorder)[0];
|
||||
}
|
||||
|
||||
@@ -31,7 +31,17 @@ import {IContainerElement, Renderer} from "./renderer/Renderer";
|
||||
|
||||
export interface ISettings {
|
||||
onHyperlink?(create: () => HTMLElement, hyperlink: {url: () => string}): IContainerElement;
|
||||
onPicture?(isLegacy: boolean, create: () => HTMLElement): HTMLElement;
|
||||
|
||||
/**
|
||||
* Callback which is called with information about the type of picture and a function to render it.
|
||||
* The callback can then decide the output to be rendered.
|
||||
* @param isLegacy Null if the picture is the only one provided. Otherwise specifies whether the picture
|
||||
* is a legacy picture (e.g. if both an emf and a wmf version of a picture are available).
|
||||
* @param create A function which returns the result of rendering the picture.
|
||||
* @return The {HTMLElement} you want to display
|
||||
*/
|
||||
onPicture?(isLegacy: null|boolean, create: () => HTMLElement): HTMLElement;
|
||||
|
||||
onImport?(relUrls: string, callback: (data: {error?: Error, keyword?: string, blob?: ArrayBuffer,
|
||||
width?: number, height?: number}) => void): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user