<commit_before>/**
 * conjoon
 * (c) 2002-2009 siteartwork.de/conjoon.org
 * <EMAIL>
 *
 * $Author$
 * $Id$
 * $Date$
 * $Revision$
 * $LastChangedDate$
 * $LastChangedBy$
 * $URL$
 */

Ext.namespace('com.conjoon.service.twitter');

/**
 * A component for rendering an info box for a user.
 * This component will fire the "userload" event if the data of a user has
 * been loaded and rendered into this component.
 *
 * @class com.conjoon.service.twitter.UserInfoBox
 * @extends Ext.BoxComponent
 *
 * @author <NAME> <<EMAIL>>
 */
com.conjoon.service.twitter.UserInfoBox = Ext.extend(Ext.BoxComponent, {

    /**
     * @cfg {Object} autoEl
     */
    autoEl :  {
        tag : 'div',
        cls : 'com-conjoon-service-twitter-UserInfoBox'
    },

    /**
     * @cfg {com.conjoon.service.twitter.data.TweetStore} tweetStore The tweet store
     * which loads recent tweet's of a specified user. The template of this component
     * will be populated with the data of the store upon load.
     */

    /**
     * @cfg {Ext.Xtemplate} tpl template used to render the contents of this
     * component.
     */

    /**
     * @type {Ext.data.Record} _loadedUser
     */
    _loadedUser : null,


    initComponent : function()
    {
        this.addEvents(
            /**
             * @event userload
             * @param {com.conjoon.service.twitter.UserInfoBox} userInfoBox
             * @param mixed tweetRecord or TwitterUserRecord
             */
            'userload',
            /**
             * @event userloadfailed
             * @param {com.conjoon.service.twitter.UserInfoBox} userInfoBox
             * @param
             */
            'userloadfailed'
        );

        Ext.applyIf(this, {
            tpl : new Ext.XTemplate(

                '<div>',
                '<div class="x-window">',
                '<div class="x-window-tl x-panel-noheader"><div class="x-window-tr"><div class="x-window-tc" style="height:8px;"></div></div></div>',
                '<div class="x-window-bwrap">',
                '<div class="x-window-ml"><div class="x-window-mr"><div class="x-window-mc">',
                '<div>',

                '<table cellspacing="0" cellpadding="0">',
                '<tbody>',
                '<tr class="meta">',
                '<td class="image" colspan="2">',
                '<div class="profileImageCont">',
                '<img class="profileImageClass" src="{profileImageUrl}" border="0"/>',
                '</div>',
                '<div class="nameCont">',
                '<div class="screenName">{screenName}</div>',
                '<div class="name"><span class="label">Name:</span> {name}</div>',
                '</div>',
                '<div class="x-clear"></div>',
                '</td>',
                '<tr class="location">',
                '<td class="label">Location:</span></td>',
                '<td class="value">{location}</td>',
                '</tr>',
                '<tr class="web">',
                '<td class="label">Web:</span></td>',
                '<td class="value">',
                '<tpl if="url != 0">',
                '<a target="_blank" href="{url}">{url}</a>',
                '</tpl>',
                '<tpl if="url == 0">&nbsp;</tpl>',
                '</td>',
                '</tr>',
                '<tr class="description">',
                '<td class="label">Bio:</span></td>',
                '<td class="value">{description}</td>',
                '</tr>',
                '</tbody>',
                '</table>',
                '</div>',
                '</div>',
                '</div>',
                '</div>',
                '</div>',
                '<div class="x-window-bl x-panel-nofooter"><div class="x-window-br"><div class="x-window-bc"></div></div></div>',
                '</div>',
                '</div>'
            )
        });

        if (this.tweetStore) {
            this.tweetStore.on('load',       this._onTweetStoreLoad, this);
            this.tweetStore.on('beforeload', this._onBeforeTweetStoreLoad, this);
        }

        com.conjoon.service.twitter.UserInfoBox.superclass.initComponent.call(this);<commit_msg> - enhancement: added "click" listener to the element to route the clicked url in an infobox using conjoon's redirector (closes CN-299)<commit_after>/**
 * conjoon
 * (c) 2002-2009 siteartwork.de/conjoon.org
 * <EMAIL>
 *
 * $Author$
 * $Id$
 * $Date$
 * $Revision$
 * $LastChangedDate$
 * $LastChangedBy$
 * $URL$
 */

Ext.namespace('com.conjoon.service.twitter');

/**
 * A component for rendering an info box for a user.
 * This component will fire the "userload" event if the data of a user has
 * been loaded and rendered into this component.
 *
 * @class com.conjoon.service.twitter.UserInfoBox
 * @extends Ext.BoxComponent
 *
 * @author <NAME> <<EMAIL>>
 */
com.conjoon.service.twitter.UserInfoBox = Ext.extend(Ext.BoxComponent, {

    /**
     * @cfg {Object} autoEl
     */
    autoEl :  {
        tag : 'div',
        cls : 'com-conjoon-service-twitter-UserInfoBox'
    },

    /**
     * @cfg {com.conjoon.service.twitter.data.TweetStore} tweetStore The tweet store
     * which loads recent tweet's of a specified user. The template of this component
     * will be populated with the data of the store upon load.
     */

    /**
     * @cfg {Ext.Xtemplate} tpl template used to render the contents of this
     * component.
     */

    /**
     * @type {Ext.data.Record} _loadedUser
     */
    _loadedUser : null,


    initComponent : function()
    {
        this.addEvents(
            /**
             * @event userload
             * @param {com.conjoon.service.twitter.UserInfoBox} userInfoBox
             * @param mixed tweetRecord or TwitterUserRecord
             */
            'userload',
            /**
             * @event userloadfailed
             * @param {com.conjoon.service.twitter.UserInfoBox} userInfoBox
             * @param
             */
            'userloadfailed'
        );

        Ext.applyIf(this, {
            tpl : new Ext.XTemplate(

                '<div>',
                '<div class="x-window">',
                '<div class="x-window-tl x-panel-noheader"><div class="x-window-tr"><div class="x-window-tc" style="height:8px;"></div></div></div>',
                '<div class="x-window-bwrap">',
                '<div class="x-window-ml"><div class="x-window-mr"><div class="x-window-mc">',
                '<div>',

                '<table cellspacing="0" cellpadding="0">',
                '<tbody>',
                '<tr class="meta">',
                '<td class="image" colspan="2">',
                '<div class="profileImageCont">',
                '<img class="profileImageClass" src="{profileImageUrl}" border="0"/>',
                '</div>',
                '<div class="nameCont">',
                '<div class="screenName">{screenName}</div>',
                '<div class="name"><span class="label">Name:</span> {name}</div>',
                '</div>',
                '<div class="x-clear"></div>',
                '</td>',
                '<tr class="location">',
                '<td class="label">Location:</span></td>',
                '<td class="value">{location}</td>',
                '</tr>',
                '<tr class="web">',
                '<td class="label">Web:</span></td>',
                '<td class="value">',
                '<tpl if="url != 0">',
                '<a href="{url}">{url}</a>',
                '</tpl>',
                '<tpl if="url == 0">&nbsp;</tpl>',
                '</td>',
                '</tr>',
                '<tr class="description">',
                '<td class="label">Bio:</span></td>',
                '<td class="value">{description}</td>',
                '</tr>',
                '</tbody>',
                '</table>',
                '</div>',
                '</div>',
                '</div>',
                '</div>',
                '</div>',
                '<div class="x-window-bl x-panel-nofooter"><div class="x-window-br"><div class="x-window-bc"></div></div></div>',
                '</div>',
                '</div>'
            )
        });

        if (this.tweetStore) {
            this.tweetStore.on('load',       this._onTweetStoreLoad, this);
            this.tweetStore.on('beforeload', this._onBeforeTweetStoreLoad, this);
        }

        var clickListener = com.conjoon.groupware.util.LinkInterceptor.getListener();

        for (var i in clickListener) {
            this.on(i, clickListener[i]);
        }

        com.conjoon.service.twitter.UserInfoBox.superclass.initComponent.call(this);
{'fraction_non_alphanumeric': 0.1751189509109899, 'fraction_numerical': 0.003829639085528606, 'mean_word_length': 1.6615194564546016, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, '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': '7482432', 'n_tokens_mistral': 2544, 'n_tokens_neox': 2540, 'n_words': 494}