odoo.define('jd_notice.board', function (require) {
    "use strict";

    var chat_manager = require('mail.chat_manager');
    var composer = require('mail.composer');
    var ChatThread = require('mail.ChatThread');
    var utils = require('mail.utils');
    var base = require('web_editor.base');
    var config = require('web.config');
    var ControlPanelMixin = require('web.ControlPanelMixin');
    var core = require('web.core');
    var data = require('web.data');
    var data_manager = require('web.data_manager');
    var Dialog = require('web.Dialog');
    var framework = require('web.framework');
    var Model = require('web.Model');

    var pyeval = require('web.pyeval');
    var SearchView = require('web.SearchView');
    var Widget = require('web.Widget');

    var QWeb = core.qweb;
    var _t = core._t;
    var ChatAction = require('mail.chat_client_action');
    var session = require('web.session');
    var noticeModel = new Model('jd.notice', session.user_context);
    var newsModel = new Model('jd.news', session.user_context);
    var todoModel = new Model('jd.notice.todo', session.user_context);
    var domain = [];
    var limit = 10;
    core.action_registry.get('mail.chat.instant_messaging').include({
        start: function () {
            var self = this;
            this._super.apply(this, arguments);
            console.log('ChatActionEx start....')
            // noticeModel.call('notice_fetch', [domain], {limit: limit, context: session.user_context}).then(function (data) {
            //     var html = "";
            //     for(var index in data){
            //         html += "<tr style=\"height: 25px;\">";
            //         var item = data[index];
            //         var categName = item['categ_name']
            //         var title = item['title'];
            //         var date = item['send_date'];
            //         var url = item['url'];
            //         html += "<td style=\"width: 90%;\"><a href='" + url + "' target='_blank'>"+ '【' + categName + '】' + title+"</a></td>";
            //         html += "<td style=\"line-break: unset;width:120px;\">" + date + "</td>";
            //         html += "</tr>";
            //     }
            //     $("#notice-list").html(html);
            // });

            // newsModel.call('news_fetch', [domain], {limit: limit, context: session.user_context}).then(function (data) {
            //     var html = "";
            //     for(var index in data){
            //         html += "<tr style=\"height: 25px;\">";
            //         var item = data[index];
            //         var title = item['title'];
            //         var categName = item['categ_name']
            //         var date = item['send_date'];
            //         var url = item['url'];
            //         html += "<td style=\"width: 90%;\"><a href='" + url + "' target='_blank'>"+ '【' + categName + '】' + title+"</a></td>";
            //         html += "<td style=\"line-break: unset;width:120px;\">" + date + "</td>";
            //         html += "</tr>";
            //     }
            //     $("#news-list").html(html);
            // });

            // todoModel.call('get_enable_config', [], {context: session.user_context}).then(function(data){
            //     console.log(data);
            //     var dataRender = {}
            //     if(data['contentTemplateName']) {
            //         var elementHtml = QWeb.render(data['contentTemplateName'], dataRender);
            //         $("#todoList").html(elementHtml);
            //     }
            //
            //     if(data['model'] && data['method']) {
            //         var dataModel = new Model(data['model'], session.user_context)
            //         dataModel.call(data['method'], [], {context: session.user_context}).then(function(result) {
            //             dataRender = result
            //             console.log(result)
            //             var elementHtml = QWeb.render(data['contentTemplateName'], dataRender);
            //             $("#todoList").html(elementHtml);
            //         })
            //     }
            // })
            // todoModel.call('get_system_config', [{"configName": 'portal_demo_data_todo'}], {context: session.user_context}).then(function(data) {
            //     $("#todoList").html(data);
            // })
            //
            // todoModel.call('get_system_config', [{"configName": 'portal_demo_data_notify', "context": session.user_context}], {context: session.user_context}).then(function(data) {
            //     $("#notifyList").html(data);
            // })
            //
            // todoModel.call('get_system_config', [{"configName": 'portal_demo_data_focus'}], {context: session.user_context}).then(function(data) {
            //     $("#focusList").html(data);
            // })
            //
            // todoModel.call('get_system_config', [{"configName": 'portal_demo_data_warn'}], {context: session.user_context}).then(function(data) {
            //     $("#warnList").html(data);
            // })
        }
    });

});
