Skip to content
Snippets Groups Projects

Fix timeline div factory in accordance to rekall initialization

3 files
+ 26
34
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -143,6 +143,29 @@ Tag.prototype.update = function (color, strong) {
this.color = "#000000";
}
Tag.prototype.createTimelineDiv = function () {
if(this.getMetadata("Rekall->Highlight")){
return CreateHighlightedTimeLineDiv.call(this);
}
return CreateTimeLineDiv.call(this)
}
Tag.prototype.getLabels = function () {
let labels = this.getMetadata('Rekall->Labels');
if (!labels)
return [];
let isStringNullOrWhitspace = function (s) {
if (typeof s !== "string" || !s) {
return false;
}
return !s.trim();
}
return labels.split(';').filter(s => !isStringNullOrWhitspace(s));
}
const CreateTimeLineDiv = function(){
let that = this;
let styleColor = "background-color: " + this.color + ";";
let textColor2 = "color: rgba(255,255,255,.8)";
@@ -185,30 +208,9 @@ Tag.prototype.createTimelineDiv = function () {
});
return this.flattenTimelineDom;
}
Tag.prototype.getLabels = function () {
let labels = this.getMetadata('Rekall->Labels');
if (!labels)
return [];
let isStringNullOrWhitspace = function (s) {
if (typeof s !== "string" || !s) {
return false;
}
return !s.trim();
}
return labels.split(';').filter(s => !isStringNullOrWhitspace(s));
}
function HighLightedTag(data) {
Tag.call(this, data.Document);
}
HighLightedTag.prototype = Object.create(Tag.prototype);
HighLightedTag.prototype.createTimelineDiv = function () {
const CreateHighlightedTimeLineDiv = function () {
let that = this;
let styleColor = "background-color: " + this.color + ";";
let textColor = "color: " + this.color + ";";
@@ -270,13 +272,3 @@ HighLightedTag.prototype.createTimelineDiv = function () {
return this.flattenTimelineDom;
}
const TagFactory = function (document) {
if (document.getMetadata("Rekall->Highlight", document.currentVersion)) {
return new HighLightedTag({document: document})
}
return new Tag(document);
}
\ No newline at end of file
Loading