//kuaishow.com 
//jackysuy
function EditorInit(formId, inputId, callBack) {
    KE.show({
        id: inputId,
        filterMode: true,
        allowUpload: false,
        allowFileManager: false,
        afterCreate: function (id) {
            KE.event.ctrl(document, 13, function () {
                KE.util.setData(id);
                $("#" + formId).submit();
            });
            KE.event.ctrl(KE.g[id].iframeDoc, 13, function () {
                KE.util.setData(id);
                $("#" + formId).submit();
            });
        },
        afterChange: typeof callBack === 'function' ? function (id) { callBack(KE.count(id, 'text')) } : null
    });
}

//显示上传文件选择框 0-编辑器 1-文本框 w=0不水印，其他都水印
function showUpload(obj, type, w) {
    art.dialog.open('/inc/fileiframe/iframe.aspx?input=' + obj + '&type=' + type + "&w=" + w, {
        id: "mypropic",
        title: '上传文件选择',
        lock: true,
        fixed: true,
        width: 760,
        height: 360
    });
}

function showSelect(obj, type) {
    art.dialog.open('/inc/fileiframe/select.aspx?input=' + obj + '&type=' + type, {
        id: "mypropic",
        title: '选择提示器',
        lock: true,
        fixed: true
    });
}

function callCount(num) {
    $("#contentnum").html(num);
}

function chkPut(val) {
    $("#titlenum").html(val.length);
}

function askcom(url) {
    art.dialog.open(url, { id: 's', title: '提问操作' });
}
function usercom(url,w,h) {
    art.dialog.open(url, {
        id: 's',
        width: w == 0 ? 'auto' : w,
        height: h == 0 ? 'auto' : h,
        title: '用户管理操作'
    });
}

//var postSubmited = false;
//function editor_ctlent(event) {
//    alert(window.event.keyCode);
////    if (postSubmited == false && ((event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83))) {
////        postSubmited = true;
////        //$('#postsubmit').click();
////    }
////    return;
//}