{"size": 1275, "ext": "js", "max_stars_repo_path": "lib/atom-whois-view.js", "max_stars_repo_name": "giovazz89/atom-whois", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/atom-whois-view.js", "max_issues_repo_name": "giovazz89/atom-whois", "max_issues_repo_issues_event_min_datetime": "2017-01-20T14:04:48.000Z", "max_issues_repo_issues_event_max_datetime": "2019-09-16T18:04:31.000Z", "max_forks_repo_path": "lib/atom-whois-view.js", "max_forks_repo_name": "giovazz89/atom-whois", "max_forks_repo_forks_event_min_datetime": "2019-02-27T01:47:19.000Z", "max_forks_repo_forks_event_max_datetime": "2019-02-27T01:47:19.000Z"}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 26.0204081633, "max_line_length": 72, "alphanum_fraction": 0.6345098039}
'use babel';

export default class AtomWhoisView {

    constructor(serializedState) {
        // Create root element
        this.element = document.createElement('div');
        this.element.classList.add('atom-whois');
    }

    // Returns an object that can be retrieved when package is activated
    serialize() {}

    // Tear down any state and detach
    destroy() {
        this.element.remove();
    }

    getElement() {
        return this.element;
    }

    setText(title, text, centered = 0) {
        while (this.element.firstChild)
            this.element.removeChild(this.element.firstChild);

		header = document.createElement('h3');
        header.classList.add('text-center');
        header.textContent = title;
        this.element.appendChild(header);

        message = document.createElement('p');
		if(centered) message.classList.add('text-center');
        message.textContent = text;
        this.element.appendChild(message);
    }

	clearText(){
        while (this.element.firstChild)
            this.element.removeChild(this.element.firstChild);

		message = document.createElement('h3');
        message.classList.add('text-center');
        message.textContent = 'Loading whois data...';
        this.element.appendChild(message);
	}

}
