Skip to content

Commit

Permalink
Fixed an issue with parsing thumbnail hover text for data
Browse files Browse the repository at this point in the history
  • Loading branch information
bitWolfy committed Apr 26, 2020
1 parent b6bad31 commit 06c3a6d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/js/modules/search/ThumbnailsEnhancer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { RE6Module, Settings } from "../../components/RE6Module";
import { PageDefintion } from "../../components/data/Page";
import { Util } from "../../components/structure/Util";
import { GM } from "../../components/api/GM";
import { Danbooru } from "../../components/api/Danbooru";
import { GM } from "../../components/api/GM";
import { PageDefintion } from "../../components/data/Page";
import { ModuleController } from "../../components/ModuleController";
import { RE6Module, Settings } from "../../components/RE6Module";
import { Util } from "../../components/structure/Util";

export enum ThumbnailPerformanceMode {
Disabled = "disabled",
Expand Down Expand Up @@ -229,9 +229,15 @@ export class ThumbnailEnhancer extends RE6Module {
const $extrasBox = $("<div>")
.addClass("bg-highlight preview-extras")
.appendTo($link);
$("<span>").html($imgData[4]).appendTo($extrasBox);
$("<span>").html(parseRating($imgData[0])).appendTo($extrasBox);
$("<span>").html(parseDate($imgData[2])).appendTo($extrasBox);

if ($imgData[4] === undefined) $("<span>").html("Score: ?").appendTo($extrasBox);
else $("<span>").html($imgData[4]).appendTo($extrasBox);

if ($imgData[0] === undefined) $("<span>").html("unknown").appendTo($extrasBox);
else $("<span>").html(parseRating($imgData[0])).appendTo($extrasBox);

if ($imgData[2] === undefined) $("<span>").html("unknown").appendTo($extrasBox);
else $("<span>").html(parseDate($imgData[2])).appendTo($extrasBox);

// Voting Buttons
const $voteBox = $("<div>")
Expand Down

0 comments on commit 06c3a6d

Please sign in to comment.