<commit_before>YUI().add('bookie-chrome', function (Y) {
    var ns = Y.namespace('bookie.chrome');

    /**
     * The View object to the extension popup page.
     *
     * @class Popup
     * @extends Y.View
     * @namespace bookie.chrome
     *
     */
    ns.Popup = Y.Base.create('bookie-chrome-view', Y.View, [], {
        /**
         * By default we haven't loaded any recent tags. If we do, update this
         * so that we don't load them again.
         *
         */
        loaded_recent: false,

        /**
         * We need to bind the bookie icon to the site that your settings say
         * you're using. This is because Bookie can be self hosted and it's
         * the only way to know where to link to.
         *
         * @method _bind_site_link
         *
         */
        _bind_site_link: function () {
            var url = this.api_cfg.url
            url = url.replace(/api\/v1\/?/, '');
            url = url + this.api_cfg.username;
            Y.one('#bookie_site').set('href', url);
        },

        _build_suggested_tags: function (suggestions) {
            // see if we have the last set of tags to add
            var tag_html = new Y.NodeList();
                tag_container = Y.one('#latest_tags');

            for (tag in suggestions) {
                 tag_html.push(Y.Node.create('<a href="" class="prev_tag">' + suggestions[tag] + '</a>'));
            }

            tag_container.appendChild(tag_html);
            Y.one('#suggested_tags').show();
        },

        /**
         * Process deleting a bookmark requested by the extension.
         *
         * @method _handle_delete
         * @param {Event} e
         *
         */
        _handle_delete: function (e) {
            e.preventDefault();

            var model = this.get('model');
            var hashid = model.get('hash_id');

            model.remove(function (c) {
                localStorage.removeItem(hashid);
                window.close();
            });
        },

        /**
         * Process storing a bookmark via the API.
         *
         * @method _handle_submit
         * @param {Event} e
         *
         */
        _handle_save: function (e) {
            e.preventDefault();
            this.indicator.show();
            var model = this.get('model');

            // we need to set the content to be part of the model for this
            // request so we can pass it along, even though the content
            // isn't really valid for it.
            model.addAttr('content', {});

            // we have to do these changes in one fell swoop to prevent a mass
            // firing of the "init_model" callback on the model:change event
            model.setAttrs({
                url: Y.one('#url').get('value'),
                inserted_by: Y.one('#inserted_by').get('value'),
                description: Y.one('#description').get('value'),
                tags: Y.Array.map(this.tag_control.get('tags'), function (t) {
                    return t.get('text');
                }),<commit_msg>Remove unused arg<commit_after>YUI().add('bookie-chrome', function (Y) {
    var ns = Y.namespace('bookie.chrome');

    /**
     * The View object to the extension popup page.
     *
     * @class Popup
     * @extends Y.View
     * @namespace bookie.chrome
     *
     */
    ns.Popup = Y.Base.create('bookie-chrome-view', Y.View, [], {
        /**
         * By default we haven't loaded any recent tags. If we do, update this
         * so that we don't load them again.
         *
         */
        loaded_recent: false,

        /**
         * We need to bind the bookie icon to the site that your settings say
         * you're using. This is because Bookie can be self hosted and it's
         * the only way to know where to link to.
         *
         * @method _bind_site_link
         *
         */
        _bind_site_link: function () {
            var url = this.api_cfg.url
            url = url.replace(/api\/v1\/?/, '');
            url = url + this.api_cfg.username;
            Y.one('#bookie_site').set('href', url);
        },

        _build_suggested_tags: function (suggestions) {
            // see if we have the last set of tags to add
            var tag_html = new Y.NodeList();
                tag_container = Y.one('#latest_tags');

            for (tag in suggestions) {
                 tag_html.push(Y.Node.create('<a href="" class="prev_tag">' + suggestions[tag] + '</a>'));
            }

            tag_container.appendChild(tag_html);
            Y.one('#suggested_tags').show();
        },

        /**
         * Process deleting a bookmark requested by the extension.
         *
         * @method _handle_delete
         * @param {Event} e
         *
         */
        _handle_delete: function (e) {
            e.preventDefault();

            var model = this.get('model');
            var hashid = model.get('hash_id');

            model.remove(function () {
                localStorage.removeItem(hashid);
                window.close();
            });
        },

        /**
         * Process storing a bookmark via the API.
         *
         * @method _handle_submit
         * @param {Event} e
         *
         */
        _handle_save: function (e) {
            e.preventDefault();
            this.indicator.show();
            var model = this.get('model');

            // we need to set the content to be part of the model for this
            // request so we can pass it along, even though the content
            // isn't really valid for it.
            model.addAttr('content', {});

            // we have to do these changes in one fell swoop to prevent a mass
            // firing of the "init_model" callback on the model:change event
            model.setAttrs({
                url: Y.one('#url').get('value'),
                inserted_by: Y.one('#inserted_by').get('value'),
                description: Y.one('#description').get('value'),
                tags: Y.Array.map(this.tag_control.get('tags'), function (t) {
                    return t.get('text');
                }),
{'fraction_non_alphanumeric': 0.12216233872284828, 'fraction_numerical': 0.00032663726931242854, 'mean_word_length': 1.4985720114239085, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2466733', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1646, 'n_words': 479}