/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 btoe.cn
*
* @author 微风 <350096958@qq.com>
* @site http://www.wjdhcms.com/

*******************************************************************************/



KindEditor.plugin("draggin", function(K) {
    var self = this,
        name = 'draggin',
        undefined;
    var editor = this;
    // 点击图标时执行
    editor.clickToolbar(name, function() {
    	var html = self.html();
        var index = parent.layer.open({
            type: 2,
            area: ['60%', '60%'],
            fixed: false, //不固定
            maxmin: true,
            content: '/cc/tools/editor/plugins/draggin/index.html',
            btn: ['提交', '取消'], //按钮
            yes: function(index, layero) {
                var _html = parent.layer.getChildFrame('#content', index).html();
                console.log(_html)
                    //_html=_html.replace(/src=\"http:\/\/[^/]+/ig,"src=\"");
                self["html"](_html);
                parent.layer.close(index); 
            },
            btn2: function(index, layero) {
                //按钮【按钮二】的回调

                //return false 开启该代码可禁止点击该按钮关闭
            }
        })
    });
});
