{"size": 5304, "ext": "js", "max_stars_repo_path": "src/app/livetv/highlight/highlight.component.js", "max_stars_repo_name": "cumtRobin/my-app", "max_stars_repo_stars_event_min_datetime": "2019-08-29T06:12:44.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-29T06:12:44.000Z", "max_issues_repo_path": "src/app/livetv/highlight/highlight.component.js", "max_issues_repo_name": "cumtRobin/videowebsite", "max_issues_repo_issues_event_min_datetime": "2017-12-14T15:17:44.000Z", "max_issues_repo_issues_event_max_datetime": "2017-12-23T06:09:40.000Z", "max_forks_repo_path": "src/app/livetv/highlight/highlight.component.js", "max_forks_repo_name": "cumtRobin/videowebsite", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 82.875, "max_line_length": 2652, "alphanum_fraction": 0.7079562594}
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component } from '@angular/core';
var HighlightComponent = (function () {
    function HighlightComponent() {
        this.keyword = '';
        this.hasStopInput = true;
        this.checkInputTimer = null;
        this.textContent = 'this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.this is an article for test.The system will collect your usage data (such as your browsing history, login/logout records, and viewing history) for refined operations. The system will mine and analyze your preferences based on your usage data. When you browse content recommendation slots or search for content, the system will recommend personalized content based on your preferences, helping you find your favorite content more quickly.';
        this.innerHTML = this.textContent;
    }
    HighlightComponent.prototype.ngOnInit = function () {
    };
    HighlightComponent.prototype.inputKeydown = function (e) {
        clearTimeout(this.checkInputTimer);
        this.hasStopInput = false;
    };
    HighlightComponent.prototype.inputKeyup = function (e) {
        var _this = this;
        this.keyword = e.target.value;
        clearTimeout(this.checkInputTimer);
        this.checkInputTimer = setTimeout(function () {
            _this.hasStopInput = true;
            _this.doHighLight();
        }, 500);
    };
    HighlightComponent.prototype.doHighLight = function () {
        if (this.textContent.includes(this.keyword) && this.keyword !== '') {
            var textArray = this.textContent.split(this.keyword);
            this.innerHTML = this.getNewInnerHTML(textArray);
        }
        else {
            this.innerHTML = this.textContent;
        }
    };
    HighlightComponent.prototype.getNewInnerHTML = function (textArray) {
        var result = '';
        for (var i = 0, length_1 = textArray.length; i < length_1; i++) {
            result += textArray[i];
            if (i !== length_1 - 1) {
                result += '<span style="color:#FCCB35">' + this.keyword + '</span>';
            }
        }
        return result;
    };
    HighlightComponent = __decorate([
        Component({
            selector: 'app-highlight',
            templateUrl: './highlight.component.html',
            styleUrls: ['./highlight.component.scss']
        }),
        __metadata("design:paramtypes", [])
    ], HighlightComponent);
    return HighlightComponent;
}());
export { HighlightComponent };
