zoukankan      html  css  js  c++  java
  • MOSS自带RichText Editor控件的使用

    当我们自己在_layouts下或者MOSS的应用程序池里的项目想使用MOSS自带的RichText Editor控件:      

    其实用户很简单,2步搞定:

    1. 复制脚本

      <link rel="stylesheet" type="text/css" href="/_layouts/2052/styles/core.css?rev=XygLPcJn29Jca2z%2BY5dhJg%3D%3D"/>
      <script type="text/javascript" language="javascript" src="/_layouts/2052/init.js?rev=TM1Msc%2Fl%2BXA2XeDqqb5Kxg%3D%3D"></script>
      <script type="text/javascript" language="javascript" src="/_layouts/2052/core.js?rev=oOYctOq3H5IaEOyxwORXzw%3D%3D" defer></script>
      <script type="text/javascript" language="javascript" src="/_layouts/portal.js?rev=cRI8b5r5N%2BkLhIuWR03ICg%3D%3D"></script>
      <script type="text/javascript" language="javascript" src="/_layouts/2052/ie55up.js?rev=Ni7%2Fj2ZV%2FzCvd09XYSSWvA%3D%3D"></script>
      <script type="text/javascript" language="javascript" src="/_layouts/2052/form.js?rev=6SC%2FzbjAV4FBM2lpYMMhtQ%3D%3D"></script>
      <script type="text/javascript" language="javascript" src="/_layouts/2052/SpellCheckEntirePage.js?rev=fTgS1Hx3qAogZoY4h%2FsaPg%3D%3D"></script>
      <script type="text/javascript" language="javascript" src="/_layouts/Serialize.js?rev=yoPAvZ5aIeY93U62X8ie%2FQ%3D%3D"></script>
    2. 填入脚本

      <span dir="none">
          
      <span dir="ltr">
                  
      <textarea name="comment" rows="6" cols="20" id="comment" title="说明" class="ms-long" dir="none"></textarea>
                  
      <input name="comment_spSave" type="HIDDEN" id="comment_spSave" />
              
      </span>
          
      <script>if (browseris.ie5up && browseris.win32 && !IsAccessibilityFeatureEnabled()){RTE_ConvertTextAreaToRichEdit("comment"truefalse"""2052"nullnullnullnullnull,"Compatible""\u002f",null,null,false,null,null,null,null,null,null,true,null);}else{document.write("&nbsp;<br><SPAN class=ms-formdescription><a href='javascript:HelpWindowKey(\"nsrichtext\")'>请单击此处了解有关添加基本 HTML 格式的帮助。</a></SPAN>&nbsp;<br>");};</script>
          
      </span>
    3. 控制大小

          #comment
          
      {
              width
      : 356px;
          
      }
    4. 获取RTE: 变量strHtml中

       var strHtml;
              
      var strBaseElementID = "comment";
              
      //var elemTextArea=RTE_GetEditorTextArea(strBaseElementID);
              var docEditor=RTE_GetEditorDocument(strBaseElementID);
              strHtml
      =docEditor.body.innerHTML;
    5. 更改样式:FullHtml

      RTE_ConvertTextAreaToRichEdit("comment"truefalse"""2052"nullnullnullnullnull,"FullHtml""\u002f",null,null,false,null,null,null,null,null,null,true,null);
    6. 使用示例: 信息反馈收集
    7. 第二种方法最简单了:

      <PublishingWebControls:RichHtmlField id="ArticleAbstract" FieldName="ArticleAbstract" 
                AllowExternalUrls
      ="false" 
                AllowFonts
      ="true" 
                AllowReusableContent
      ="false" 
                AllowHeadings
      ="false"
                AllowHyperlinks
      ="false"
                AllowImages
      ="false"
                AllowLists
      ="false"
                AllowTables
      ="false"
                AllowTextMarkup
      ="false" 
                AllowHTMLSourceEditing
      ="false"
                DisalbeBasicFormattingButtons
      ="false"
                runat
      ="server"/>
       
  • 相关阅读:
    VS.NET 2010 新功能 [整理]
    Sculpture 基于MDD的集成开发平台
    更换VS.NET 2010的皮肤 [Visual Studio Blog]
    SQL Server BI Step by Step SSIS 7 (End) 事务,错误输出,事件处理,日志记录
    和我一起学CSLA.NET设计模型及数据访问
    Visual Studio DSL 入门 2
    SQL Server BI Step by Step SSIS 5 通过Email发送查询结果
    SQL Server BI Step by Step SSRS 1Reporting Service 2008的新特性
    SQL Server BI Step by Step SSRS 2SQL Server 2008 Reporting Services实现匿名访问报表
    和我一起学CSLA.NET先忽悠下
  • 原文地址:https://www.cnblogs.com/Areas/p/2196475.html
Copyright © 2011-2022 走看看