$(document).ready(function()
{
// jQuery Start
  var ke_cfg = {
    //urlType:'absolute',
    indentChar:'  ',
    allowFlashUpload:true,
    allowMediaUpload:true,
    allowFileManager:true,
    filterMode:false
  }
  var editor1 = KindEditor.create('textarea.ke-con',ke_cfg);
  var editor2 = KindEditor.create('textarea.ke-scon',ke_cfg);
  var editor3 = KindEditor.create('textarea.ke-spcon',{
    resizeType:1,
    //urlType:'absolute',
    indentChar:'  ',
    allowPreviewEmoticons:false,
    allowImageUpload:false,
    items:[
      'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
      'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
      'insertunorderedlist', '|', 'emoticons', 'image', 'link'
    ]
  });

  var uploader = KindEditor.editor({urlType:'absolute',allowFileManager:true})
  $('.upbtn.image').click(function()
  {
    uploader.loadPlugin('image',function()
    {
      uploader.plugin.imageDialog({
        //showLocal : false,//只浏览
        showRemote : false,//只上传
        imageUrl : $('#upipt').val(),
        clickFn : function(url, title, width, height, border, align)
        {
          $('#upipt').val(url);
          uploader.hideDialog();
        }
      });
    });
  });
  $('.fmbtn.image').click(function()
  {
    uploader.loadPlugin('filemanager', function()
    {
      uploader.plugin.filemanagerDialog({
        viewType : 'VIEW',
        dirName : 'image',
        clickFn : function(url, title) {
          $('#upipt').val(url);
          uploader.hideDialog();
        }
      });
    });
  });
// jQuery End
});