/**
 * Created with JetBrains WebStorm.
 * User: dfwang
 * Date: 14-7-14
 * Time: 下午3:46
 * To change this template use File | Settings | File Templates.
 */
define(function(require, exports) {
    var commands =   require('editor/assert/js/utils/commands').commands;
    var AppContext=require('../../../../share/assert/js/appcontext').AppContext;
    fabric.HotSpace.prototype.showEditDialog=function(opt, finishcallback){
        var _that = this,phtml='',tablecot=null;
        //opt &&(this.path = opt);
        var info = null;
        //如果是新建添加一个rid
        if (!_that.rid) {
            info = {
                "src": '',
                "title": "热区",
                "des": "",
                "type": _that.type
            };
            //push到Relation中避免重复创建
            _that.rid = Global.CurrentSlide.c.addRelationInfo(info);
        }
        finishcallback && (this.callback = finishcallback);
        var dlg = $('<div id="modal-content" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog test_temp">'+
            '<div class="test_temp_tit">'+
            '<a href="javascript:;" class="test_temp_close" data-dismiss="modal" title="关闭">X</a>'+
        '编辑热区'+
        '</div>'+
        '<div class="tst_temp_step tst_temp_hot_area">'+
            '<ul class="graph_list">'+
                '<li>'+
                    '<p>添加文件</p>'+
                    '<ul class="graph_list_sun clearfix">'+
                        '<li>'+
                            '<a href="javascript:;" class="graph_list_close"></a>'+
                        '</li>'+
                        '<li>'+
                            '<a href="javascript:;" class="graph_list_close"></a>'+
                        '</li>'+
                        '<li>'+
                            '<a href="javascript:;" class="graph_list_close"></a>'+
                            '<img alt="" src="editor/assert/images/pop/graph_list_img.png">'+
                            '</li>'+
                            '<li>'+
                                '<a href="javascript:;" title="新增图形" class="graph_list_add"></a>'+
                            '</li>'+
                        '</ul>'+
                    '</li>'+
                '</ul>'+
                '<p class="hot_area_edit_tip">'+
                '您最多可以添加4个文件'+
                '</p>'+
            '</div>'+
            '<div class="test_temp_btns hot_area_func">'+
                '<div class="area_border fl">'+
                    '<input type="checkbox" name="area_border[]">隐藏热区边框'+
                    '</div>'+
                    '<a href="javascript:;" class="test_temp_btn_nor fr" title="确定">确定</a>'+
                '</div>'+
            '</div></div>');
        $('body').append(dlg);
        dlg.modal({show: true});
        //_that.callback.call(_that,{})
    };
    fabric.HotSpace.prototype.hidePropertyButton = function(){
        commands.usePropertyCtrlArea(null);
    }
    fabric.HotSpace.prototype.showPropertyButton = function()
    {
        commands.usePropertyCtrlArea('object');
    }
});