require.config({
    paths: {
        'fastim': '../addons/fastim/js/fastim'
    },
    shim: {
        'fastim': {
            deps: ['css!../addons/fastim/css/fastim_default.css'],
            exports: 'FastIm'
        }
    }
});
if (Config.modulename == 'admin' && Config.controllername == 'index' && Config.actionname == 'index') {
    require(['fastim'], function (FastIm) {
        FastIm.initialize(document.domain);
    });
} else {

    try {
        var parentConifg = window.parent.Config;
    } catch (err) {
        var parentConifg = false;
    }

    if (parentConifg && parentConifg.modulename == 'admin') {
        // 监听后台 iframe 内的快捷键打开会话窗口
        $(document).on('keyup', function (event) {
            if (window.parent.FastIm && event.keyCode === 191 && event.ctrlKey) {
                window.parent.FastIm.common.extractMessage();
            }
        })
    } else {
        require(['fastim'], function (FastIm) {
            FastIm.initialize(document.domain);
        });
    }
}