1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-18 16:25:13 +00:00

Appeasing the gods of JSHint

This commit is contained in:
Jeremy Ruston
2012-11-06 17:21:56 +00:00
parent 54252a5400
commit 9f6909ddc4
28 changed files with 69 additions and 66 deletions

View File

@@ -13,19 +13,19 @@ Parses an image into a parse tree containing an HTML img element
"use strict";
var ImageParser = function(options) {
this.wiki = options.wiki;
this.wiki = options.wiki;
};
ImageParser.prototype.parse = function(type,text) {
var element = "img",
src;
if(type === "application/pdf" || type === ".pdf") {
src = "data:application/pdf;base64," + text;
element = "embed";
} else if(type === "image/svg+xml" || type === ".svg") {
src = "data:image/svg+xml," + encodeURIComponent(text);
var element = "img",
src;
if(type === "application/pdf" || type === ".pdf") {
src = "data:application/pdf;base64," + text;
element = "embed";
} else if(type === "image/svg+xml" || type === ".svg") {
src = "data:image/svg+xml," + encodeURIComponent(text);
} else {
src = "data:" + type + ";base64," + text;
src = "data:" + type + ";base64," + text;
}
return new $tw.Renderer([$tw.Tree.Element(element,{src: src})],new $tw.Dependencies());
};