<commit_before>import Widget from '../../js/widget';

/**
 * @extends Widget
 */
class UrlWidget extends Widget {

    static get selector() {
        return '.or-appearance-url input[type="text"]';
    }

    _init() {
        const fragment = document.createRange().createContextualFragment( '<a class="widget url-widget" target="_blank"/>' );

        this.element.classList.add( 'hide' );
        this.element.after( fragment );

        this.value = this.originalInputValue;
    }

    update() {
        this.value = this.originalInputValue;
    }

    get value() {
        return this.question.querySelector( '.url-widget' ).href;
    }

    set value( value ) {
        value = value || '';
        const link = this.question.querySelector( '.url-widget' );
        link.href = value;
        link.title = value;
        link.textContent = value;
    }<commit_msg>added: rel="noopener" to URL widget links (#634)<commit_after>import Widget from '../../js/widget';

/**
 * @extends Widget
 */
class UrlWidget extends Widget {

    static get selector() {
        return '.or-appearance-url input[type="text"]';
    }

    _init() {
        const fragment = document.createRange().createContextualFragment( '<a class="widget url-widget" target="_blank" rel="noopener"/>' );

        this.element.classList.add( 'hide' );
        this.element.after( fragment );

        this.value = this.originalInputValue;
    }

    update() {
        this.value = this.originalInputValue;
    }

    get value() {
        return this.question.querySelector( '.url-widget' ).href;
    }

    set value( value ) {
        value = value || '';
        const link = this.question.querySelector( '.url-widget' );
        link.href = value;
        link.title = value;
        link.textContent = value;
    }
{'fraction_non_alphanumeric': 0.14810690423162584, 'fraction_numerical': 0.0016703786191536749, 'mean_word_length': 2.340148698884758, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4305516', 'n_tokens_mistral': 524, 'n_tokens_neox': 516, 'n_words': 115}