zoukankan      html  css  js  c++  java
  • 部分FCKeditor常用JS函数

    // JScript 文件
      
    //预览
    function preview() {
    oFCKeditor.Value=FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML(true);
    FCKeditorAPI.GetInstance('FCKeditor1').Preview();
    }
    //源代码/编辑转换
    function viewsrc()
    {
    var obj=FCKeditorAPI.GetInstance('FCKeditor1');
    oFCKeditor.Value=obj.GetXHTML(true);
    obj.SwitchEditMode(FCK_EDITMODE_SOURCE);
    if(obj.EditMode==FCK_EDITMODE_SOURCE)
    {
    document.getElementById("btn_src").value="编辑";
    document.getElementById("btn_src").title="以所见即所得模块编辑";
    }
    else
    {
    document.getElementById("btn_src").value="源代码";
    document.getElementById("btn_src").title="以源代码模块编辑";
    }
      
    }
    //增加编辑区大小
    function upsize()
    {
      var height=oFCKeditor.Height;
      if(height<1200)
      {
        oFCKeditor.Height=oFCKeditor.Height+200;
        document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
      } 
      if(oFCKeditor.Height>1000)
        document.getElementById("btn_upsize").disabled="disabled";
      document.getElementById("btn_downsize").disabled="";    
    }
    //减小编辑区大小
    function downsize()
    {
      var height=oFCKeditor.Height;
      if(height>200)
      {
        oFCKeditor.Height=oFCKeditor.Height-200;
        document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
      }
      if(oFCKeditor.Height<400)
        document.getElementById("btn_downsize").disabled="disabled";
      document.getElementById("btn_upsize").disabled="";
      
    }
    //去除字符串首尾空格
    String.prototype.trim = function()
    {
        // 用正则表达式将前后空格
        // 用空字符串替代。
        return this.replace(/(^s*)|(s*$)/g, "");
    }
    //重置编辑器(清空)
    function resetFCKEditor()
    {
    FCKeditorAPI.GetInstance('FCKeditor1').SetHTML("");
    }
    //插入HTML代码到当前位置
    function inserthtml()
    {
      var htmlstr=document.getElementById("insertstr").value;
      if(htmlstr.length>2)
      {
        FCKeditorAPI.GetInstance('FCKeditor1').InsertHtml(htmlstr);
      }
      document.getElementById("insertstr").value="";
    }
  • 相关阅读:
    redis主从同步机制
    聊聊Redis持久化
    Redis集群架构中主节点选举机制
    命令注入
    《小狗钱钱》
    nginx---反向代理缓存
    nginx ---IP地址透传
    实现前端调度器nginx收到请求,调度到后端Apache、实现动静分离
    nginx---防止盗链
    nginx--当用户访问到公司网站的时输入了一个错误的URL,可以将用户重定向至官网首页
  • 原文地址:https://www.cnblogs.com/yeagen/p/1370897.html
Copyright © 2011-2022 走看看