<commit_before>(// support reloading for development
function(override){
var id = 'App.controller.Chat'
   ,cfg = {
    extend:'App.controller.Base',
    __name: id,
    models:[
        'chatUser'
    ],
    views:[
        'Chat'
    ],
    refs:[
        { ref: 'Chat', selector: '[wmId=Chat]' }
    ],
    chat: null,
    init:
    function controllerChatInit(){
    var me = this
       ,sid = 'chatUsers'
       ,users, chat

        chat = me.getView('Chat').create({
            renderTo: Ext.getCmp('desk').getEl()
        })

        chat.on({
            destroy: destroyChat
        })

        chat.down('[title=' + l10n.um.chat.users + ']').add(
        {
            xtype: 'grid',
            header: false,
            hideHeaders: true,
            columns: App.cfg.modelChatUser.columns,
            store: users = Ext.StoreManager.lookup(sid) || Ext.create('App.store.CRUD',
            {
                storeId: sid,
                url: App.cfg.modelChatUser.url,
                model: App.model.userman.chatUser
            })
        })

        me.chat = chat

        // some developer friendly stuff
        chat.down('[type=help]').el.dom.setAttribute(
'data-qtip',
'dev info, app module: <b>userman</b>;<br>' +
'classes:<br><b>`model.userman.chatUser`<br>`view.Chat`<br>`controller.Chat`</b>'
        )

        return

        function destroyChat(){
        var s, ev
           ,bus = me.application.eventbus.bus
           ,i = me.refs.length - 1

            Ext.StoreManager.lookup(sid).destroyStore()
            Ext.Ajax.request({ url: '/um/lib/chat/deve' })// reload backend api
            // models, stores, etc can be reloaded here
            do {
                s = me.refs[i].selector
                for(ev in bus){
                    (s = bus[ev][s]) && s.Chat && delete s.Chat
                }
            } while(i--)
            console.log('destroyController')

            me.application.controllers.removeAtKey('Chat')
            me.destroy()
        }
    }
}<commit_msg>um.controller.Chat: reload backend using `App.backend.req`<commit_after>(// support reloading for development
function(override){
var id = 'App.controller.Chat'
   ,cfg = {
    extend:'App.controller.Base',
    __name: id,
    models:[
        'chatUser'
    ],
    views:[
        'Chat'
    ],
    refs:[
        { ref: 'Chat', selector: '[wmId=Chat]' }
    ],
    chat: null,
    init:
    function controllerChatInit(){
    var me = this
       ,sid = 'chatUsers'
       ,users, chat

        chat = me.getView('Chat').create({
            renderTo: Ext.getCmp('desk').getEl()
        })

        chat.on({
            destroy: destroyChat
        })

        chat.down('[title=' + l10n.um.chat.users + ']').add(
        {
            xtype: 'grid',
            header: false,
            hideHeaders: true,
            columns: App.cfg.modelChatUser.columns,
            store: users = Ext.StoreManager.lookup(sid) || Ext.create('App.store.CRUD',
            {
                storeId: sid,
                url: App.cfg.modelChatUser.url,
                model: App.model.userman.chatUser
            })
        })

        me.chat = chat

        // some developer friendly stuff
        chat.down('[type=help]').el.dom.setAttribute(
'data-qtip',
'dev info, app module: <b>userman</b>;<br>' +
'classes:<br><b>`model.userman.chatUser`<br>`view.Chat`<br>`controller.Chat`</b>'
        )

        return

        function destroyChat(){
        var s, ev
           ,bus = me.application.eventbus.bus
           ,i = me.refs.length - 1

            Ext.StoreManager.lookup(sid).destroyStore()
            App.backend.req('/um/lib/chat/deve')// reload backend api
            // models, stores, etc can be reloaded here
            do {
                s = me.refs[i].selector
                for(ev in bus){
                    (s = bus[ev][s]) && s.Chat && delete s.Chat
                }
            } while(i--)
            console.log('destroyController')

            me.application.controllers.removeAtKey('Chat')
            me.destroy()
        }
    }
}
{'fraction_non_alphanumeric': 0.14652014652014653, 'fraction_numerical': 0.0014652014652014652, 'mean_word_length': 1.5728643216080402, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4653982', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1215, 'n_words': 234}