sqUbbEditor UBB 编辑器 v1.0 by shawl.qiu

31 篇文章 0 订阅
16 篇文章 0 订阅

 sqUbbEditor UBB 编辑器 v1.0 by shawl.qiu

CREATED BY STABX, AT 2007-5-6.

sqUbbEditor UBB 编辑器

---/-------------------------------------------------------------

Version 1.0

老早前就想过写个功能完整点人性点的 Ubb 编辑器, 不过倒是先写了两个 HTML 编辑器...

1. sqEditor HTML 编辑器 v1.3 By shawl.qiu(asp) (新版本 1.4 尚未发布)
http://blog.csdn.net/btbtd/archive/2007/01/16/1484070.aspx

2. sqEditor HTML 编辑器 for .net v1.0 By shawl.qiu (新版本 1.1 尚未发布)
http://blog.csdn.net/btbtd/archive/2007/03/03/1519745.aspx

不过本次在写这个 UBB 编辑器的时候, 倒是收获不小, 随便扯谈一下本人觉得收获得比较不错的两点:

1. 使用 js 取元素相对于屏幕的绝对位置, 适用于各浏览器.
方案:
  1. function fFindPos(oEle, sReturnBy)
  2. { // shawl.qiu script
  3.  if(!oEle)
  4.  {
  5.   alert("对象不能为空!");
  6.   return;
  7.  }
  8.  
  9.  if(sReturnBy!="y")
  10.  {
  11.   return fFindPosX(oEle);
  12.  }
  13.  else
  14.  {
  15.   return fFindPosY(oEle);
  16.  }
  17.  
  18.  function fFindPosX(oEle)
  19.  { // shawl.qiu script
  20.   var iLeft = 0;
  21.   if(oEle.offsetParent)
  22.   {
  23.    while(true)
  24.    {
  25.     iLeft += oEle.offsetLeft;
  26.     if(!oEle.offsetParent)
  27.     {
  28.       break;
  29.     } // end if 1
  30.     oEle = oEle.offsetParent;
  31.    } // end while
  32.   }
  33.   else if(oEle.x)
  34.   {
  35.     iLeft += oEle.x;
  36.   }
  37.   return iLeft;
  38.  } // end function fFindPosX
  39.  
  40.  function fFindPosY(oEle)
  41.  { // shawl.qiu script
  42.   var iTop = 0;
  43.   if(oEle.offsetParent)
  44.   {
  45.    while(true)
  46.    {
  47.     iTop += oEle.offsetTop;
  48.     if(!oEle.offsetParent)
  49.     {
  50.       break;
  51.     } // end if 1
  52.     oEle = oEle.offsetParent;
  53.    } // end while
  54.   }
  55.   else if(oEle.y)
  56.   {
  57.     iTop += oEle.y;
  58.   }
  59.   return iTop;
  60.  } // end function fFindPosX
  61. } // end function fFindPos

2. css 完美定义 pre/定义自动换行.
  1. pre
  2. {
  3.  white-space: pre; /* CSS2 */
  4.  white-space: -moz-pre-wrap; /* Mozilla */
  5.  white-space: -hp-pre-wrap; /* HP printers */
  6.  white-space: -o-pre-wrap; /* Opera 7 */
  7.  white-space: -pre-wrap; /* Opera 4-6 */
  8.  white-space: pre-wrap; /* CSS 2.1 */
  9.  white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
  10.  word-wrap: break-word; /* IE */
  11.  padding:2px;
  12. }

还有不少收获, 这个...我并不总是很慷慨, 或者说我不想一次性的慷慨.


话归正题, UBB 编辑器的主要功能概述:

1. 数据入库时不编码, 数据显示时 JS 自动编码. (这样有多方面的好处, 概念问题, 恕不详细)
2. 可以动态设置是否编码 UBB
3. 可以动态设置是否编码 媒体文件
4. 可以动态设置是否 自动识别链接
5. 可以动态设置是否添加 CSS 文件
6. 编辑时可以预览HTML 效果.
7. 编辑时可以预览HTML 源码
8. ... 具体功能自己体会.

 
调用参考:
--/------------------------------
1. 以列表显示 UBB 域 调用
  1. <script type='text/javascript' src='/sqUbbEditor/default.js'></script>
  2. <script type="text/javascript">
  3. //<![CDATA[
  4.  onload =
  5.   function()
  6.   {
  7.    
  8.    Ubb.Main.Path = "/sqUbbEditor/";
  9.    
  10.    Ubb.Encode.ID = 'UbbEncodeMain';
  11.    Ubb.Encode.Bool = true;
  12.    Ubb.Encode.Media.Bool = false;
  13.    Ubb.Encode.AutoAttachLink = true;
  14.    Ubb.Encode.TabLen = 2;
  15.    Ubb.Encode.WidthForIe = "100%";
  16.    Ubb.Encode.AppendCss = true;
  17.    Ubb.Encode.Go();
  18.   } // end onload
  19.   //]]>
  20. </script>
  21. <div id="UbbEncodeMain"> <!-- 主ID -->
  22.  <pre>
  23.   ubb 内容
  24.  </pre>
  25.  
  26.  <pre>
  27.   ubb 内容
  28.  </pre>
  29.  
  30.  ...
  31. </div>

2. 主显示页调用
  1. <script type='text/javascript' src='/sqUbbEditor/default.js'></script>
  2. <script type="text/javascript">
  3. //<![CDATA[
  4.  onload =
  5.   function()
  6.   {
  7.    
  8.    Ubb.Main.Path = "/sqUbbEditor/";
  9.    
  10.    Ubb.Encode.ID = 'UbbEncodeMain';
  11.    Ubb.Encode.Bool = <% 
  12.  Response.Write(
  13.   bool.Parse(
  14.    Datum.GetDataTable(
  15.    "select * from guestbook where gbid="+gbid, Conn).Rows[0]["gbubbdisable"]+"")?"false":"true"
  16.   );
  17.   %>;
  18.    Ubb.Encode.TabLen = 2;
  19.    Ubb.Encode.WidthForIe = "100%";
  20.    Ubb.Encode.AppendCss = true;
  21.    Ubb.Encode.Go();
  22.    
  23.   } // end onload
  24.   //]]>
  25. </script>
  26. <div id="UbbEncodeMain" class="UbbMain">
  27.  <pre>
  28.   内容
  29.  </pre>
  30. </div>

详细情况请看 /sqUbbEditor/demo/ 使用演示(asp.net c#)


Author: shawl.qiu
E-Mail: shawl.qiu@gmail.com
Blog: http://blog.csdn.net/btbtd/
CreatedDate: 2007-5-6

© 2007-2010 shawl.qiu. All rights reserved.


下载:
http://files.myopera.com/btbtd/sqUbbEditor/sqUbbEditor_v1.0.7z


目录:
1. sqUbbEditor 核心代码

shawl.qiu
2007-5-6
http://blog.csdn.net/btbtd/

内容:
1. sqUbbEditor 核心代码
  1. // shawl.qiu JavaScript Document

  2.  /*-----------------------------------------------------------------------------------*/
  3.   * sqUbbEditor UBB 编辑器 v1.0
  4.  /*-----------------------------------------------------------------------------------*/
  5.  //---------------------------------begin class Ubb()-------------------------------//
  6.  function sqUbbEditor()
  7.  { // shawl.qiu code
  8.   //------------------------------------begin public variable
  9.   //---------------begin about
  10.   this.auSubject = 'sqUbbEditor UBB 编辑器';
  11.   this.auVersion = 'v1.0';
  12.   this.au = 'shawl.qiu';
  13.   this.auEmail = 'shawl.qiu@gmail.com';
  14.   this.auBlog = 'http://blog.csdn.net/btbtd';
  15.   this.auCreateDate = '2007-5-3';
  16.   //---------------end about
  17.   this.Main = function(){};
  18.   this.Main.ID = "UbbMain";
  19.   this.Main.Path = "/sqUbbEditor/";
  20.   
  21.   this.Main.Text = function(){};
  22.   this.Main.Text.ID = "UbbTextMain";
  23.   
  24.   this.Encode = function(){}
  25.   this.Encode.ID = "UbbEncodeMain";
  26.   this.Encode.Bool = true;
  27.   
  28.   this.Encode.Media = function(){}
  29.   this.Encode.Media.Bool = true;
  30.   
  31.   this.Encode.AutoAttachLink = true;
  32.   
  33.   this.Encode.Go = fEncode;
  34.   this.Encode.TabLen = 2;
  35.   this.Encode.WidthForIe = "100%";
  36.   this.Encode.WidthForIeByPre = "100%";
  37.   this.Encode.AppendCss = true;
  38.   
  39.   this.Encode.Director = function(){}
  40.   this.Encode.Director.Go = fEncodePre;
  41.   this.Encode.Director.AppendCss =
  42.    function(oDocument)
  43.    {
  44.     fAppendStyle(Tl.Main.Path+"style/css.css", oDocument);
  45.     fAppendStyle(Tl.Main.Path+"style/ubb.css", oDocument);
  46.    }
  47.   
  48.   this.Reload = "?";
  49.   
  50.   this.CallBack = null;
  51.   
  52.   this.Debug = false;
  53.   
  54.   this.Cmd = fCmd;
  55.   
  56.   this.Exec = fExec;
  57.   
  58.   this.Test = function(oParent, sTargetId)
  59.   {
  60.   }
  61.   
  62.   this.Clear = function(){}
  63.   this.Clear.Html = false;
  64.   
  65.   this.Width = function()
  66.   {
  67.    return "650px;";
  68.   }
  69.   
  70.   this.Select = fSelect;
  71.   this.Popup = fWinPopup;
  72.   this.Print = fPrint;
  73.   this.Func = fFunc;
  74.   //------------------------------------end public variable
  75.   
  76.   //------------------------------------begin private variable
  77.   var Tl = this;
  78.   var pMain = null;
  79.   var pTextMain = null;
  80.   var pUbbHtmlPath = "html/Ubb.htm";
  81.   
  82.   var pRndStr = "";
  83.   var pFormSubmitFunc = null;
  84.   var pFormSubmitFunc1 = null;
  85.   var pFormResetFunc = null;
  86.   var pForm = null;
  87.   
  88.   var pEncodeMain = null;
  89.   var pDecodeTempStr = "";
  90.   //------------------------------------end private variable
  91.   
  92.   //------------------------------------begin public method
  93.   
  94.   //------------------------------------end public method
  95.  
  96.   //------------------------------------begin private method
  97.   
  98.   function fEncode()
  99.   {
  100.    if(!Tl.Encode.Bool) return;
  101.    
  102.    pEncodeMain = document.getElementById(Tl.Encode.ID);
  103.    if(pEncodeMain==null)
  104.    {
  105.     alert("解码 Ubb 域为 null!");
  106.     return false;
  107.    }
  108.    
  109.    if(Tl.Encode.AppendCss)
  110.    {
  111.     fAppendStyle(Tl.Main.Path+"style/css.css");
  112.     fAppendStyle(Tl.Main.Path+"style/ubb.css");
  113.    }
  114.    
  115.    if(fIsIe())
  116.    {
  117.     pEncodeMain.style.width = Tl.Encode.WidthForIe;
  118.     pEncodeMain.style.overflow = "hidden";
  119.    }
  120.    
  121.    var PreSet = pEncodeMain.getElementsByTagName("pre");
  122.    
  123.    for(var i=0, j=PreSet.length; i<j; i++)
  124.    {
  125.     fEncodePre(PreSet[i]);
  126.    } // end for
  127.   } // end function fEncode
  128.   
  129.   function fEncodePre(ElePre, oDocument, EleAdti)
  130.   {
  131.    if(!oDocument) oDocument = document; 
  132.    
  133.    if(typeof(ElePre)=="object")
  134.    { 
  135.     var sTemp = ElePre.innerHTML;
  136.    }
  137.    else
  138.    {
  139.     var sTemp = ElePre;
  140.    }
  141.    
  142.    // tag len, unit by space
  143.    if(Tl.Encode.TabLen!=null&&Tl.Encode.TabLen>0)
  144.    {
  145.     sTemp = sTemp.
  146.      replace(//t/gi, fStrSpace("&nbsp;", Tl.Encode.TabLen));
  147.    } 
  148.    
  149.    // [align]
  150.    //alert(ElePre.innerHTML);
  151.    sTemp = sTemp.
  152.    replace(//[align=([^/]]+)/]/gi, "<div align='$1' class='UbbAlign$1'>")
  153.    ;
  154.    sTemp = sTemp.
  155.     replace(//[//align/](/r/n|/r|/n)*/gi, "</div>")
  156.     ;  
  157.     
  158.    // [code]
  159.    sTemp = sTemp.
  160.     replace(//[(code)/](/r/n|/r|/n)*/gi, "[code][ol]")
  161.     ;  
  162.    sTemp = sTemp.
  163.     replace(//[//(code)/](/r/n|/r|/n)*/gi, "[/ol][/code]")
  164.     ;  
  165.     
  166.    
  167.    sTemp = sTemp.
  168.     replace(//[(quote|cite|code)/](/r/n|/r|/n)*/gi, "<div class='Ubb$1'>")
  169.     ;  
  170.    sTemp = sTemp.
  171.     replace(//[//(quote|cite|code)/](/r/n|/r|/n)*/gi, "</div><br/>")
  172.     ;  
  173.     
  174.     
  175.    var s1Dims = "b|i|u|del|sup|sub|pre|quote|cite|h1|h2|h3|h4|h5|h6";
  176.    var Re1Dims = new RegExp("//[("+s1Dims+")//]", "gi");
  177.    var Re1Dims1 = new RegExp("//[///("+s1Dims+")//]", "gi");
  178.    
  179.    sTemp = sTemp.
  180.     replace(Re1Dims, "<$1 class='Ubb$1'>").
  181.     replace(Re1Dims1,"</$1>")
  182.     ;
  183.     
  184.    sTemp = sTemp.
  185.     replace(//[(hr|br)///](/r/n|/r|/n)*/gi, "<$1/>")
  186.     ;
  187.     
  188.    sTemp = sTemp.
  189.     replace
  190.     (/(/[ol/])([/s/S]*?)(/[//ol/])(/r/n|/r|/n)*/gi, 
  191.      function($1, $2, $3, $4)
  192.      {
  193.        $2 = "<ol class='Ubbol'>";
  194.        return fReplaceList($1, $2, $3, $4);
  195.      } // end functoin
  196.     ) // end replace
  197.     ;
  198.    
  199.    sTemp = sTemp.
  200.     replace
  201.     (/(/[ul/])([/s/S]*?)(/[//ul/](/r/n|/r|/n)*)/gi, 
  202.      function($1, $2, $3, $4)
  203.      { 
  204.        $2 = "<ul class='Ubbul'>";
  205.        return fReplaceList($1, $2, $3, $4);
  206.      } // end functoin
  207.     ) // end replace
  208.     ;
  209.     
  210.    // [bgcolor] && [fgcolor]
  211.    sTemp = sTemp.
  212.     replace
  213.     (
  214.       //[bgcolor/=([^/]]+)/]/gi,
  215.       "<span style='background-color:$1!important'>"
  216.     )
  217.     ; 
  218.    sTemp = sTemp.
  219.     replace
  220.     (
  221.       //[fgcolor/=([^/]]+)/]/gi,
  222.       "<span style='color:$1!important'>"
  223.     )
  224.     ;
  225.    sTemp = sTemp.
  226.     replace
  227.     (
  228.       //[//(bgcolor|fgcolor)/]/gi,
  229.       "</span>"
  230.     )
  231.     ;
  232.     
  233.    // [email]
  234.    sTemp = sTemp.
  235.     replace
  236.     (
  237.      /(/[email/])([/s/S]+?)/[//email/]/gi,
  238.      function($1, $2, $3)
  239.      {
  240.       if($3.indexOf($2)>-1)
  241.       {
  242.         return $1;
  243.       }
  244.       return "<a href='mailto:"+fStrTrim($3)+"' target='_blank' class='Ubbemail'>"+$3+"</a>";
  245.      }
  246.     )
  247.     ;
  248.     
  249.    // [url]
  250.    sTemp = sTemp.
  251.     replace
  252.     (
  253.      /(/[url/])([/s/S]+?)/[//url/]/gi,
  254.      function($1, $2, $3)
  255.      {
  256.       if($3.indexOf($2)>-1)
  257.       {
  258.         return $1;
  259.       }
  260.       return "<a href='"+fStrTrim($3)+"' target='_blank' class='Ubburl'>"+$3+"</a>";
  261.      }
  262.     )
  263.     ;
  264.     
  265.    // [anchor]
  266.    sTemp = sTemp.
  267.     replace
  268.     (
  269.      /(/[anchor/])([/s/S]+?)/[//anchor/]/gi,
  270.      function($1, $2, $3)
  271.      {
  272.       if($3.indexOf($2)>-1)
  273.       {
  274.         return $1;
  275.       }
  276.       return "<a name='"+fStrTrim($3)+"' class='Ubbanchor'>"+$3+"</a>";
  277.      }
  278.     )
  279.     ;
  280.     
  281.    // [img]
  282.    sTemp = sTemp.
  283.     replace
  284.     (
  285.      /(/[img/])([/s/S]+?)/[//img/]/gi,
  286.      function($1, $2, $3)
  287.      {
  288.       if($3.indexOf($2)>-1)
  289.       {
  290.         return $1;
  291.       }
  292.       return "<img src='"+fStrTrim($3)+"' class='Ubbimg' />";
  293.      }
  294.     )
  295.     ;
  296.     
  297.    // [icon]
  298.    sTemp = sTemp.
  299.     replace
  300.     (
  301.      //[icon/=([^///[]+)///]/gi,
  302.     "<img src='"+Tl.Main.Path+"emotion/$1' class='Ubbicon' />"
  303.     )
  304.     ;
  305.     
  306.    if(Tl.Encode.Media.Bool)
  307.    {
  308.     // [swf]
  309.     sTemp = sTemp.
  310.      replace
  311.      (
  312.       //[swf/=(/d+),(/d+)/]([/s/S]+?)/[//swf/]/gi,
  313.       function($1, $2, $3, $4)
  314.       {
  315.        if($4.indexOf("[swf")>-1)
  316.        {
  317.          return $1;
  318.        }
  319.        $4 = fStrTrim($4);
  320.        return fDisplaySwf($2, $3, $4, "Ubbswf");
  321.       }
  322.      )
  323.      ;
  324.      
  325.     // [rm]
  326.     sTemp = sTemp.
  327.      replace
  328.      (
  329.       //[rm/=(/d+),(/d+)/]([/s/S]+?)/[//rm/]/gi,
  330.       function($1, $2, $3, $4)
  331.       {
  332.        if($4.indexOf("[rm")>-1)
  333.        {
  334.          return $1;
  335.        }
  336.        $4 = fStrTrim($4);
  337.        return fDisplayRm($2, $3, $4, "Ubbrm");
  338.       }
  339.      )
  340.      ;
  341.     sTemp = sTemp.
  342.      replace
  343.      (
  344.       //[rm]([/s/S]+?)/[//rm]/gi,
  345.       function($1, $2)
  346.       {
  347.        if($2.indexOf("[rm")>-1)
  348.        {
  349.          return $1;
  350.        }
  351.        $2 = fStrTrim($2);
  352.         return fDisplayRm(300, 0, $2, "Ubbrm");
  353.       }
  354.      )
  355.      ;
  356.      
  357.     // [wmp]
  358.     sTemp = sTemp.
  359.      replace
  360.      (
  361.       //[wmp/=(/d+),(/d+)/]([/s/S]+?)/[//wmp/]/gi,
  362.       function($1, $2, $3, $4)
  363.       {
  364.        if($4.indexOf("[wmp")>-1)
  365.        {
  366.          return $1;
  367.        }
  368.        $4 = fStrTrim($4);
  369.        return fDisplayWmp($2, $3, $4, "Ubbwmp");
  370.       }
  371.      )
  372.      ;
  373.     sTemp = sTemp.
  374.      replace
  375.      (
  376.       //[wmp]([/s/S]+?)/[//wmp]/gi,
  377.       function($1, $2)
  378.       {
  379.        if($2.indexOf("[wmp")>-1)
  380.        {
  381.          return $1;
  382.        }
  383.        $2 = fStrTrim($2);
  384.         return fDisplayWmp(300, 68, $2, "Ubbwmp");
  385.       }
  386.      )
  387.      ;
  388.    } // end if
  389.      
  390.    if(fIsIe())
  391.    {
  392.     sTemp = sTemp.replace(//r/n/g, "HHJFGHJhjgJHGJHG787687JHKJh9889")
  393.      ;
  394.     
  395.     if(typeof(ElePre)=="object")
  396.     {
  397.      ElePre.innerHTML = sTemp.
  398.       replace(/HHJFGHJhjgJHGJHG787687JHKJh9889/gi, "<br/>");
  399.       ;
  400.     }
  401.     else
  402.     {
  403.      EleAdti.innerHTML = sTemp.
  404.       replace(/HHJFGHJhjgJHGJHG787687JHKJh9889/gi, "<br/>");
  405.       ;
  406.     }
  407.    }
  408.    else
  409.    {
  410.     if(typeof(ElePre)=="object")
  411.     {
  412.      ElePre.innerHTML = sTemp;
  413.     }
  414.     else
  415.     {
  416.      EleAdti.innerHTML = sTemp.
  417.       replace(/HHJFGHJhjgJHGJHG787687JHKJh9889/gi, "<br/>");
  418.       ;
  419.     }
  420.    }
  421.    
  422.    if(Tl.Encode.AutoAttachLink)
  423.    {
  424.     if(typeof(ElePre)=="object")
  425.     {
  426.      fDomAtcLink(ElePre, oDocument);
  427.     }
  428.     else
  429.     {
  430.      fDomAtcLink(EleAdti, oDocument);
  431.       ;
  432.     }
  433.    }
  434.   } // end function fEncodePre
  435.   
  436.   function fDomAtcLink(oEle, oDocument, sLinkCssName, sEmailCssName, sTarget)
  437.   {
  438.    if(!oDocument) oDocument = document;
  439.    if(!sTarget) sTarget = "_blank";
  440.    if(!sLinkCssName) sLinkCssName = "Ubburl";
  441.    if(!sEmailCssName) sEmailCssName = "Ubbemail";
  442.    
  443.    var oNode, sStr='', oSpan;
  444.    for(var i=0, j=oEle.childNodes.length; i<j; i++)
  445.    {
  446.     oNode=oEle.childNodes[i];
  447.     if(oNode.nodeType==3)
  448.     {
  449.      if(oNode.parentNode.nodeName=='A')return false;
  450.      
  451.      if(oNode.data.indexOf('http')<0&&oNode.data.indexOf('ftp')<0&&
  452.       oNode.data.indexOf('@')<0)continue;
  453.      
  454.      oSpan=oDocument.createElement('span');
  455.      sStr=oNode.data.replace(//&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  456.      //sStr=sqMethod.encode(oNode.data);
  457.      sStr=sStr.replace(/(ht|f)tp(s|)/:[/-/w.:]+(//[^ /n/r/'/"]+|)/gi,function(match){
  458.         return '<a href="'+match+'" class="sqUrl '+
  459.         sLinkCssName+'" target="'+sTarget+'">'+match+'</a>'; } ); 
  460.      sStr=sStr.replace(/[/w.]+@[/w/-.]+(//[^ /n/r/'/"]+|)/gi,function(match){
  461.         return '<a href="mailto:'+match+'" class="sqMail '+sEmailCssName+'">'+match+'</a>'; } ); 
  462.      oSpan.innerHTML=sStr;
  463.      oEle.replaceChild(oSpan, oNode);
  464.     } // end if
  465.     if(oNode.nodeType==1)arguments.callee(oEle.childNodes[i], oDocument);
  466.    } // end for
  467.    oNode=oSpan=null; // shawl.qiu script
  468.   } // end function fDomAtcLink
  469.   
  470.   function fDisplayWmp(iWidth, iHeight, sPath, sDivCssName)
  471.   {
  472.    if(!sPath) 
  473.    {
  474.     alert("wmp 路径 不能为空!");
  475.     return;
  476.    }
  477.    
  478.    sPath = sPath.replace(/^/s*|/s*$/g, "");
  479.   
  480.    if(!iWidth) iWidth = 500;
  481.    if(!iHeight) iHeight = 68;
  482.    if(!sDivCssName) sDivCssName = "Ubbwmp";
  483.    
  484.    return "<div class='"+sDivCssName+"'>"+ 
  485.    "<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"+
  486.    " class=OBJECT id=MediaPlayer width="+iWidth+" height="+iHeight+" >"+
  487.    "<param name=ShowStatusBar value=-1>"+
  488.    "<param name=Filename value="+sPath+">"+
  489.    "<embed type=application/x-oleobject "+
  490.    "codebase=http://activex.microsoft.com/activex/controls/mplayer/en/"+
  491.    "nsmp2inf.cab#Version=5,1,52,701 flename=mp src="+sPath+"  width="+iWidth+" height="+iHeight+">"+
  492.    "</embed>"+
  493.    "</object>"+
  494.    "</div>"
  495.    ;
  496.   } // end function fDisplayWmp
  497.   
  498.   function fDisplayRm(iWidth, iHeight, sPath, sDivCssName)
  499.   {
  500.    if(!sPath) 
  501.    {
  502.     alert("rm 路径 不能为空!");
  503.     return;
  504.    }
  505.    
  506.    sPath = sPath.replace(/^/s*|/s*$/g, "");
  507.    if(!sDivCssName) sDivCssName = "Ubbrm";
  508.    
  509.    return "<div class='"+sDivCssName+"'>"+ 
  510.    "<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"+
  511.    " class=OBJECT id=RAOCX width="+iWidth+" height="+iHeight+">"+
  512.    "<PARAM NAME=SRC VALUE="+sPath+"><PARAM NAME=CONSOLE VALUE=Clip1>"+
  513.    "<PARAM NAME=CONTROLS VALUE=imagewindow>"+
  514.    "<PARAM NAME=AUTOSTART VALUE=true></OBJECT><br>"+
  515.    "<OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"+
  516.    " height="+32+" id=video2 width="+iWidth+">"+
  517.    "<PARAM NAME=SRC VALUE="+sPath+"><PARAM NAME=AUTOSTART VALUE=-1>"+
  518.    "<PARAM NAME=CONTROLS VALUE=controlpanel>"+
  519.    "<PARAM NAME=CONSOLE VALUE=Clip1>"+
  520.    "</OBJECT>"+
  521.    "</div>"
  522.    ;
  523.   } // end function fDisplayRm
  524.   
  525.   function fReplaceList($1, $2, $3, $4)
  526.   {
  527.    if($3.indexOf($2)>-1)
  528.    { 
  529.     return $1;
  530.    }
  531.    
  532.    var sSet = $3.split(//r/n|/r|/n/);
  533.    var sTemp = "";
  534.    for(var i=0, j=sSet.length; i<j; i++)
  535.    {
  536.     sTemp += "<li>"+sSet[i]+"</li>";
  537.    }
  538.    
  539.    return fGetTagPart($2)+sTemp+fGetTagPart($4);
  540.   }
  541.   
  542.   function fGetTagPart(ipt)
  543.   {
  544.    return ipt.replace(//[/g, "<").replace(//]/g, ">");
  545.   }
  546.   
  547.   function fDisplaySwf(iWidth, iHeight, sPath, sDivClassName)
  548.   {
  549.    if(!sPath) 
  550.    {
  551.     alert("flash 路径 不能为空!");
  552.     return;
  553.    }
  554.    
  555.    sPath = sPath.replace(/^/s*|/s*$/g, "");
  556.   
  557.    if(!iWidth) iWidth = 500;
  558.    if(!iHeight) iHeight = 500;
  559.    if(!sDivClassName) sDivClassName = "Ubbswf";
  560.    
  561.    return "<div class='"+sDivClassName+
  562.     "'><object classid=/"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000/" "+
  563.     "codebase=/"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+
  564.     "5,0,0,0/"  width=/""+iWidth+"/" height=/""+iHeight+"/">"+
  565.     "<param name=movie value=/""+sPath+"/">"+
  566.     " <param name=quality value=high>"+
  567.     "<param name=/"wmode/" value=/"transparent/">"+
  568.     "<embed src=/""+sPath+"/" quality=high "+
  569.     "pluginspage=/"http://www.macromedia.com/shockwave/download/"+
  570.     "index.cgi?P1_Prod_Version=ShockwaveFlash/" type=/"application/x-shockwave-flash/""+
  571.     "width=/""+iWidth+"/" height=/""+iHeight+"/" wmode=/"transparent/">"+
  572.     "</embed> "+
  573.     "</object>"+
  574.     "</div>";
  575.   } // end function fDisplaySwf
  576.   
  577.   function fStrTrim(sStr)
  578.   {
  579.    var o=sStr?sStr:this;
  580.    if(!o||o=='')return '';
  581.    return o.replace(/^/s+|/s+$/g,'');
  582.   } // shawl.qiu code
  583.   
  584.   function fStrSpace(nStr, nTime){
  585.    var nLen=arguments.length;
  586.    if(nLen===0){
  587.     nStr='&nbsp;'
  588.     nTime=2;
  589.    }
  590.    if(nLen==1){
  591.     nStr+='&nbsp;';
  592.     nTime=2;
  593.    }
  594.    return new Array(nTime+1).join(nStr);
  595.   } // shawl.qiu code
  596.   
  597.   function fFunc(sCmd, bOpt, vVal)
  598.   {
  599.    pTextMain.focus();
  600.    switch(sCmd)
  601.    {
  602.     case "emptyAll":
  603.      var bDel = confirm('现在清空全部内容吗?');
  604.      if(bDel)
  605.      {
  606.       pTextMain.value = "";
  607.      }
  608.      return false;
  609.      break;
  610.      
  611.     case "insertHTML":
  612.      fAppendText(pTextMain, vVal);
  613.      return false;
  614.      break;
  615.      
  616.     case "emotion":
  617.      fEmotion();
  618.      return false;
  619.      break;
  620.      
  621.     case "eraserAll":
  622.      var bCfm = confirm('现在清除所有格式吗?');
  623.      if(bCfm)
  624.      {
  625.       pTextMain.value = pTextMain.value.
  626.        replace
  627.         (
  628.           //[[^/[]+?/]/g
  629.           ,
  630.           ""
  631.         );
  632.      }
  633.      return false;
  634.      break;
  635.      
  636.     case "ClearFormat":
  637.      var bCfm = confirm('现在清除选中内容的格式吗?');
  638.      if(bCfm)
  639.      {
  640.       fClearFormat(pTextMain); 
  641.      }
  642.      return false;
  643.      break;
  644.    }
  645.    if(fCkBrs()==3) return false;
  646.    
  647.    document.execCommand(sCmd, bOpt, vVal);
  648.    return false;
  649.   }
  650.   
  651.   function fEmotion(){
  652.    Tl.Popup('about:blank', 500,500);
  653.    fXh('GET', Tl.Main.Path+'html/popup_emotion.htm'+Tl.Reload, fGetEmo);
  654.    function fGetEmo(sSrc){
  655.     sSrc=sSrc.replace(/src/="/gi,'src="'+Tl.Main.Path);
  656.     if(oPopup){
  657.      oPopup.document.write(sSrc);
  658.      oPopup.document.close();
  659.     } // end if
  660.    } // end function fGetEmo
  661.   } // end function fEmotion
  662.   
  663.   function fClearFormat(oTextMain)
  664.   { // shawl.qiu script
  665.    var txa = oTextMain;
  666.    txa.focus();
  667.    
  668.    var re=//[[^/[]+?/]/g;
  669.    
  670.    if(document.selection&&document.selection.type== "Text")
  671.    {
  672.    // IE, Opera
  673.    var oStr=document.selection.createRange();
  674.    oStr.text=oStr.text.replace(re,"");
  675.    } 
  676.    else if(window.getSelection&&txa.selectionStart>-1) 
  677.    {
  678.     // Netscape
  679.     var st=txa.selectionStart;
  680.     var ed=txa.selectionEnd;
  681.     txa.value=txa.value.substring(0,st)+
  682.     txa.value.substring(st,ed).replace(re,"")+
  683.     txa.value.slice(ed);
  684.    } 
  685.    else 
  686.    {
  687.    //txa.value+=markup;
  688.    } // end if
  689.   } // end function fAppendText
  690.   
  691.   function fAppendText(oTextMain, markup)
  692.   { // shawl.qiu script
  693.    var txa = oTextMain;
  694.    txa.focus();
  695.    
  696.    if(document.selection&&document.selection.type== "Text")
  697.    {
  698.    // IE, Opera
  699.    var oStr=document.selection.createRange();
  700.    oStr.text=oStr.text+markup;
  701.    } 
  702.    else if(window.getSelection&&txa.selectionStart>-1) 
  703.    {
  704.     // Netscape
  705.     var st=txa.selectionStart;
  706.     var ed=txa.selectionEnd;
  707.     txa.value=txa.value.substring(0,st)+
  708.     txa.value.substring(st,ed)+markup+
  709.     txa.value.slice(ed);
  710.    } 
  711.    else 
  712.    {
  713.    txa.value+=markup;
  714.    } // end if
  715.   } // end function fAppendText
  716.   
  717.   function fPrint()
  718.   {
  719.    return false;
  720.   }
  721.   
  722.   function fIsIe()
  723.   {
  724.    return navigator.appName=='Microsoft Internet Explorer';
  725.   }
  726.   
  727.   function fIsOpera(){
  728.    return navigator.appName=='Opera';
  729.   }
  730.    
  731.   function fCmd(ipt, bNotBoth)
  732.   {
  733.    if(ipt==""||!ipt)
  734.    {
  735.     alert("添加字串不能为空!");
  736.     return false;
  737.    }
  738.    PlusUbbTag(pTextMain, ipt, bNotBoth);
  739.    return false;
  740.   } // end function fCmd
  741.   
  742.   function PlusUbbTag(oTextMain, markup, bNotBoth)
  743.   { // shawl.qiu script
  744.    var txa = oTextMain;
  745.    txa.focus();
  746.    var strEnd=markup.replace(//[/ig,'[/');
  747.    if (strEnd.indexOf('=')>-1)
  748.    {
  749.     strEnd=strEnd.replace(/(.*?)/=.*?/]/,'$1]');
  750.    } // end if
  751.    
  752.    switch(strEnd.match(//[/g).length)
  753.    {
  754.     case 2:
  755.      strEnd = strEnd.replace(/(^.*?/])(.*)/, "$2$1");
  756.      break;
  757.    }
  758.    
  759.    if(document.selection&&document.selection.type== "Text")
  760.    {
  761.    // IE, Opera
  762.     var oStr=document.selection.createRange();
  763.     if(bNotBoth)
  764.     {
  765.       oStr.text = oStr.text + markup.replace(//]/g, "/]");
  766.       return false;
  767.     }
  768.     oStr.text=markup+oStr.text+strEnd;
  769.    } 
  770.    else if(window.getSelection&&txa.selectionStart>-1) 
  771.    {
  772.     // Netscape
  773.     var st=txa.selectionStart;
  774.     var ed=txa.selectionEnd;
  775.     if(bNotBoth)
  776.     {
  777.       txa.value=
  778.        txa.value.substring(0,st) + 
  779.        txa.value.substring(st,ed)+
  780.        markup.replace(//]/g, "/]")+
  781.        txa.value.slice(ed);
  782.       return false;
  783.     }
  784.     txa.value=txa.value.substring(0,st)+markup+
  785.     txa.value.substring(st,ed)+strEnd+
  786.     txa.value.slice(ed);
  787.    } 
  788.    else 
  789.    {
  790.     if(bNotBoth)
  791.     {
  792.       txa.value = txa.value + markup.replace(//]/g, "/]");
  793.       return false;
  794.     }
  795.    txa.value+=markup+strEnd;
  796.    } // end if
  797.    
  798.    return false;
  799.   } // end function PlusUbbTag
  800.   
  801.   function fAddText(ipt)
  802.   {
  803.    return false;
  804.   }
  805.   
  806.   function fExec()
  807.   {
  808.    pMain = document.getElementById(Tl.Main.ID);
  809.    pTextMain = document.getElementById(Tl.Main.Text.ID);
  810.    
  811.    if(pMain==null)
  812.    {
  813.     alert("无法获得UBB主域");
  814.     return;
  815.    } // end if
  816.    
  817.    if(pTextMain == null)
  818.    {
  819.     alert("无法获得UBB 编辑域!");
  820.     return;
  821.    }
  822.    
  823.    pForm = pTextMain.form;
  824.    
  825.    try
  826.    {
  827.     pFormSubmitFunc1 = pForm.onsubmit;
  828.    }
  829.    catch(e)
  830.    {
  831.    }
  832.    
  833.    try
  834.    {
  835.     pFormResetFunc = pForm.onreset;
  836.    }
  837.    catch(e)
  838.    {
  839.    }
  840.    
  841.    pForm.onreset =
  842.     function()
  843.     {
  844.      var bReset = false;
  845.      trybReset = pFormResetFunc(); catch(e) {}
  846.      if(bReset)
  847.      {
  848.        return true;
  849.      } // end if
  850.      return confirm("现在重置吗?");
  851.     }
  852.    
  853.    pForm.onsubmit = 
  854.     function()
  855.     {
  856.      var bSubmit = true;
  857.      trybSubmit = pFormSubmitFunc1(); catch(e) {}
  858.      if(!bSubmit)
  859.      {
  860.        return false;
  861.      } // end if
  862.      return confirm("现在提交数据吗?");
  863.     }
  864.    
  865.    if(Tl.Clear.Html)
  866.    {
  867.     try
  868.     {
  869.       pFormSubmitFunc = pForm.onsubmit;
  870.     }
  871.     catch(e)
  872.     {
  873.     } // end try
  874.     
  875.     pForm.onsubmit =
  876.      function()
  877.      {
  878.        var bSubmit = true;
  879.        trybSubmit = pFormSubmitFunc(); catch(e) {}
  880.        if(!bSubmit)
  881.        {
  882.          return false;
  883.        } // end if
  884.        pTextMain.value = pTextMain.value.replace(//>/g, "&gt;").replace(//</g,"&lt;");
  885.      };
  886.    }
  887.    
  888.    //pMain.innerHTML = "正在加载 UBB 列表, 请稍候...";
  889.    fHl(pMain, falsetrue);
  890.    fAppendStyle(Tl.Main.Path+"style/css.css");
  891.    
  892.    if(Tl.CallBack == null)
  893.    {
  894.     fXh("GET", Tl.Main.Path+pUbbHtmlPath+
  895.      Tl.Reload+fRandomLetter(20)+"="+fRandomLetter(20), fCallBack);
  896.    }
  897.    else
  898.    {
  899.     fXh("GET", Tl.Main.Path+pUbbHtmlPath+
  900.      Tl.Reload+fRandomLetter(20)+"="+fRandomLetter(20), Tl.CallBack);
  901.    } // end if
  902.    
  903.   } // end function fExec;
  904.   
  905.   function fRandomBy(nUnder, nOver){
  906.    switch(arguments.length){
  907.     case 1: return parseInt(Math.random()*nUnder+1);
  908.     case 2: return parseInt(Math.random()*(nOver-nUnder+1) + nUnder);
  909.     defaultreturn 0;
  910.    }
  911.   }  // shawl.qiu code
  912.   
  913.   function fRandomLetter(nLen, sCase){
  914.    var ar='';
  915.    var arUp=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S',
  916.     'T','U','V','W','X','Y','Z'];
  917.    var arLw=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t',
  918.     'u','v','w','x','y','z'];
  919.    var arDgt=[0,1,2,3,4,5,6,7,8,9];
  920.    
  921.    switch(sCase){
  922.     case 'upper': ar=arUp; break;
  923.     case 'lower': ar=arLw; break;
  924.     case 'letter': ar=arUp.concat(arLw)break;
  925.     default:ar=arUp.concat(arLw, arDgt);
  926.    }
  927.    if(nLen&&nLen>0){
  928.     if(!isFinite(nLen))return false;
  929.     if(nLen<0)return false;
  930.     var iLetter='';
  931.      nLen=parseInt(nLen);
  932.      for(var i=0; i<nLen; i++){
  933.       iLetter+=ar[fRandomBy(0,ar.length-1)];
  934.      }
  935.      return iLetter;
  936.    }
  937.    return ar[fRandomBy(0,ar.length-1)];
  938.   } // shawl.qiu code
  939.   
  940.   function fCallBack(ipt)
  941.   {
  942.    ipt = ipt.replace(/(src/=/")(icon)/gi, "$1"+Tl.Main.Path+"$2");
  943.    pMain.innerHTML = ipt;
  944.   }
  945.   
  946.   function fXh(sMethod, sUrl,oFunc){
  947.    var xh;
  948.    try{
  949.     xh=new XMLHttpRequest();
  950.    } catch(e) {
  951.     try{
  952.      xh=new ActiveXObject('microsoft.xmlhttp');
  953.     } catch(e){
  954.      tryxh=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e){} // end try 2
  955.     } // end try 1
  956.    } // end try
  957.    xh.open(sMethod, sUrl);
  958.    xh.onreadystatechange=function(){
  959.     if(xh.readyState==4&&xh.status==200){
  960.      if(oFunc) oFunc(xh.responseText);
  961.      else alert(xh.responseText);
  962.     }
  963.    }
  964.    xh.send(null);
  965.   } // end function fXh
  966.   
  967.   function fHl(oTag, sMsg, bClearExists)
  968.   {
  969.    if(typeof(oTag)=="string")
  970.    {
  971.     oTag = document.getElementById(oTag);
  972.    }
  973.    if(!sMsg)
  974.    {
  975.     sMsg = "正在加载 Ubb 标签列表, 请稍假...";
  976.    }
  977.    
  978.    if(bClearExists)
  979.    {
  980.     oTag.innerHTML = "";
  981.    }
  982.    
  983.    oTag.innerHTML += "<div style=/"display:table;width:100%;background-color:yellow!important;"+
  984.     "color:black!important;text-align:center!important;margin:10px 0px;/">"+
  985.     sMsg+
  986.     "</div>"; 
  987.   } // end function fHl
  988.   function fSelect(oParent, sTargetId, evt)
  989.   {
  990.    var oTemp = document.getElementById(sTargetId);
  991.    
  992.    var iPWidth = oParent.offsetWidth;
  993.    if(fIsIe())
  994.    {
  995.     oTemp.style.left = oParent.offsetLeft;
  996.     oTemp.style.top = oParent.offsetTop+oParent.offsetHeight;
  997.    }
  998.    else if(fIsOpera())
  999.    {
  1000.     oTemp.style.left = oParent.offsetLeft;
  1001.     oTemp.style.top = oParent.offsetTop+oParent.offsetHeight;
  1002.    }
  1003.    else
  1004.    {
  1005.     oTemp.style.left = fFindPos(oParent)+"px";
  1006.    }
  1007.    
  1008.    for(var i=0, j=oTemp.childNodes.length; i<j; i++)
  1009.    {
  1010.     var oTempSub = oTemp.childNodes[i];
  1011.     if(oTempSub.nodeType!=1) continue;
  1012.     oTempSub.className = "sqEditorCssBorder";
  1013.     oTempSub.style.width = iPWidth+"px";
  1014.     switch(sTargetId)
  1015.     {
  1016.      case "sqHeaderSize":
  1017.       oTempSub.onclick = 
  1018.        function()
  1019.        {
  1020.         var sTagName = this.childNodes[0].tagName.toLowerCase();
  1021.         oParent.innerHTML = sTagName;
  1022.         Tl.Cmd('['+sTagName+']');
  1023.         fHidEle(this.parentNode);
  1024.         return false;
  1025.        } // end oTempSub.onclick
  1026.       break;
  1027.       
  1028.      case "sqDdBgColor":
  1029.       oTempSub.onclick = 
  1030.        function()
  1031.        {
  1032.         var sTagName = this.innerHTML.toLowerCase();
  1033.         oParent.innerHTML = sTagName;
  1034.         oParent.style.color = this.style.color;
  1035.         oParent.style.backgroundColor = this.style.backgroundColor;
  1036.         Tl.Cmd('[bgcolor='+sTagName+']');
  1037.         fHidEle(this.parentNode);
  1038.         return false;
  1039.        } // end oTempSub.onclick
  1040.       break;
  1041.       
  1042.      case "sqDdFgColor":
  1043.       oTempSub.onclick = 
  1044.        function()
  1045.        {
  1046.         var sTagName = this.innerHTML.toLowerCase();
  1047.         oParent.innerHTML = sTagName;
  1048.         oParent.style.color = this.style.color;
  1049.         oParent.style.backgroundColor = this.style.backgroundColor;
  1050.         Tl.Cmd('[fgcolor='+sTagName+']');
  1051.         fHidEle(this.parentNode);
  1052.         return false;
  1053.        } // end oTempSub.onclick
  1054.       break;
  1055.     } // end switch
  1056.    } // end for
  1057.    fHidEle(oTemp);
  1058.     
  1059.    return false;
  1060.    
  1061.    function fHidEle(obj)
  1062.    {
  1063.     obj.style.display=='none'?obj.style.display='block':obj.style.display='none';
  1064.    } // end function fHidEle
  1065.   } // end function fSelect
  1066.     
  1067.   function fGetEleOffsetPsti(oEle, iPsti)
  1068.   {
  1069.    if(fCkBrs()!=1) return oEle.offsetLeft;
  1070.    var debug = false;
  1071.    if(debug)
  1072.    {
  1073.     alert(
  1074.      "oEle.tagName: "+oEle.tagName+
  1075.      "/noEle.offsetLeft: "+oEle.offsetLeft
  1076.     );
  1077.    }
  1078.    
  1079.    iPsti = oEle.offsetLeft;
  1080.    
  1081.    if(oEle!=null && oEle.tagName!="BODY")
  1082.    {
  1083.     iPsti+=arguments.callee(oEle.parentNode, iPsti);
  1084.    }
  1085.    return iPsti;
  1086.    
  1087.    function fCkBrs()
  1088.    {
  1089.     switch (navigator.appName)
  1090.     {
  1091.      case 'Opera': return 2;
  1092.      case 'Netscape': return 3;
  1093.      defaultreturn 1;
  1094.     }
  1095.    } // end function fCkBrs
  1096.   } // end function fGetEleOffsetPsti
  1097.   
  1098.   function fCkBrs()
  1099.   {
  1100.    switch (navigator.appName)
  1101.    {
  1102.     case 'Opera': return 2;
  1103.     case 'Netscape': return 3;
  1104.     defaultreturn 1;
  1105.    }
  1106.   } // end function fCkBrs
  1107.   
  1108.   function fAppendStyle(sPath, oDocument)
  1109.   {
  1110.    if(sPath==""||!sPath)
  1111.    {
  1112.     alert("CSS 路径不能为空!");
  1113.     return;
  1114.    }
  1115.    
  1116.    if(!oDocument)
  1117.    {
  1118.     oDocument = document;
  1119.    }
  1120.    
  1121.    var oSty=oDocument.createElement('link');
  1122.     oSty.href=sPath;
  1123.     oSty.rel='stylesheet';
  1124.     oSty.type='text/css';
  1125.     oDocument.body.insertBefore(oSty, oDocument.body.firstChild);
  1126.     oSty=null;   
  1127.   } // end function fAppendStyle
  1128.   
  1129.   function fListMtd(obj, e){
  1130.    if(!e)var e=window.event;
  1131.    var sur=e.srcElement||e.target;
  1132.    try{w.close();}catch(e){}
  1133.     w=open('','newwin','width=500,height=500,left=300,top=100,scrollbars');
  1134.     w.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
  1135.     w.document.write('<style>body{width:400px;word-w.document.writeap: break-word;}</style>');
  1136.     w.focus;
  1137.     w.document.ondblclick=function(){w.close();}
  1138.     fListMtd(obj, w);
  1139.     w.onload=function(){ w.document.title=sur.firstChild.data;};
  1140.     w.document.close();
  1141.    return true;
  1142.    function fListMtd(obj, target){
  1143.     var ar=new Array();
  1144.     var j=0;
  1145.     
  1146.     for(var i in obj){
  1147.      try{
  1148.       ar[j]=i.bold()+' '+(typeof obj[i]).fontcolor('red')+
  1149.       ' '+(obj[i]+'').fontcolor('blue');
  1150.       j++;
  1151.      }catch(e){
  1152.       ar[j]=i.bold()+' '+(typeof obj[i]).fontcolor('red')+
  1153.       (' empty').fontcolor('red').bold()
  1154.       j++;
  1155.      }
  1156.     }
  1157.     ar=ar.sort();
  1158.     for(var i=0; i<ar.length; i++){
  1159.      target.document.write(i+1,'. ',ar[i],'<br/>');
  1160.     }
  1161.     return true;
  1162.    }
  1163.   } // end function fListMtd
  1164.  
  1165.   function fFindPos(oEle, sReturnBy)
  1166.   { // shawl.qiu script
  1167.    if(!oEle)
  1168.    {
  1169.     alert("对象不能为空!");
  1170.     return;
  1171.    }
  1172.    
  1173.    if(sReturnBy!="y")
  1174.    {
  1175.     return fFindPosX(oEle);
  1176.    }
  1177.    else
  1178.    {
  1179.     return fFindPosY(oEle);
  1180.    }
  1181.    
  1182.    function fFindPosX(oEle)
  1183.    { // shawl.qiu script
  1184.     var iLeft = 0;
  1185.     if(oEle.offsetParent)
  1186.     {
  1187.      while(true)
  1188.      {
  1189.       iLeft += oEle.offsetLeft;
  1190.       if(!oEle.offsetParent)
  1191.       {
  1192.         break;
  1193.       } // end if 1
  1194.       oEle = oEle.offsetParent;
  1195.      } // end while
  1196.     }
  1197.     else if(oEle.x)
  1198.     {
  1199.       iLeft += oEle.x;
  1200.     }
  1201.     return iLeft;
  1202.    } // end function fFindPosX
  1203.    
  1204.    function fFindPosY(oEle)
  1205.    { // shawl.qiu script
  1206.     var iTop = 0;
  1207.     if(oEle.offsetParent)
  1208.     {
  1209.      while(true)
  1210.      {
  1211.       iTop += oEle.offsetTop;
  1212.       if(!oEle.offsetParent)
  1213.       {
  1214.         break;
  1215.       } // end if 1
  1216.       oEle = oEle.offsetParent;
  1217.      } // end while
  1218.     }
  1219.     else if(oEle.y)
  1220.     {
  1221.       iTop += oEle.y;
  1222.     }
  1223.     return iTop;
  1224.    } // end function fFindPosX
  1225.   } // end function fFindPos
  1226.   
  1227.   function fWinPopup(sUrl, iWidth, iHeight, sAddition){
  1228.    try{oPopup.close()}catch(e){}
  1229.    if(!sUrl)return false;
  1230.    if(!iWidth)iWidth=screen.availWidth-200;
  1231.    if(!iHeight)iHeight=screen.availHeight-150;
  1232.    if(!sAddition)sAddition='';
  1233.    var iMrgHor=(screen.availWidth-iWidth)/2;
  1234.    var iMrgVtc=(screen.availHeight-iHeight)/2;
  1235.    
  1236.    oPopup=open('about:blank','sqPopup','width='+iWidth+',height='+iHeight+',left='+iMrgHor
  1237.     +',top='+iMrgVtc+',scrollbars'+sAddition);

  1238.    oPopup.location.href=sUrl;
  1239.    oPopup.focus();
  1240.    oPopup.document.ondblclick=function(){oPopup.close();}
  1241.    oPopup.document.onkeydown=function(){ if(oPopup.event.keyCode==27)oPopup.close(); }
  1242.    return false;
  1243.   } // shawl.qiu script  
  1244.   //------------------------------------end private method
  1245.  } // shawl.qiu code
  1246.  //---------------------------------end class Ubb()---------------------------------//
  1247.  
  1248.  var Ubb = new sqUbbEditor();


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
东南亚位于我国倡导推进的“一带一路”海陆交汇地带,作为当今全球发展最为迅速的地区之一,近年来区域内生产总值实现了显著且稳定的增长。根据东盟主要经济体公布的最新数据,印度尼西亚2023年国内生产总值(GDP)增长5.05%;越南2023年经济增长5.05%;马来西亚2023年经济增速为3.7%;泰国2023年经济增长1.9%;新加坡2023年经济增长1.1%;柬埔寨2023年经济增速预计为5.6%。 东盟国家在“一带一路”沿线国家中的总体GDP经济规模、贸易总额与国外直接投资均为最大,因此有着举足轻重的地位和作用。当前,东盟与中国已互相成为双方最大的交易伙伴。中国-东盟贸易总额已从2013年的443亿元增长至 2023年合计超逾6.4万亿元,占中国外贸总值的15.4%。在过去20余年中,东盟国家不断在全球多变的格局里面临挑战并寻求机遇。2023东盟国家主要经济体受到国内消费、国外投资、货币政策、旅游业复苏、和大宗商品出口价企稳等方面的提振,经济显现出稳步增长态势和强韧性的潜能。 本调研报告旨在深度挖掘东南亚市场的增长潜力与发展机会,分析东南亚市场竞争态势、销售模式、客户偏好、整体市场营商环境,为国内企业出海开展业务提供客观参考意见。 本文核心内容: 市场空间:全球行业市场空间、东南亚市场发展空间。 竞争态势:全球份额,东南亚市场企业份额。 销售模式:东南亚市场销售模式、本地代理商 客户情况:东南亚本地客户及偏好分析 营商环境:东南亚营商环境分析 本文纳入的企业包括国外及印尼本土企业,以及相关上下游企业等,部分名单 QYResearch是全球知名的大型咨询公司,行业涵盖各高科技行业产业链细分市场,横跨如半导体产业链(半导体设备及零部件、半导体材料、集成电路、制造、封测、分立器件、传感器、光电器件)、光伏产业链(设备、硅料/硅片、电池片、组件、辅料支架、逆变器、电站终端)、新能源汽车产业链(动力电池及材料、电驱电控、汽车半导体/电子、整车、充电桩)、通信产业链(通信系统设备、终端设备、电子元器件、射频前端、光模块、4G/5G/6G、宽带、IoT、数字经济、AI)、先进材料产业链(金属材料、高分子材料、陶瓷材料、纳米材料等)、机械制造产业链(数控机床、工程机械、电气机械、3C自动化、工业机器人、激光、工控、无人机)、食品药品、医疗器械、农业等。邮箱:market@qyresearch.com
完整版:https://download.csdn.net/download/qq_27595745/89522468 【课程大纲】 1-1 什么是java 1-2 认识java语言 1-3 java平台的体系结构 1-4 java SE环境安装和配置 2-1 java程序简介 2-2 计算机中的程序 2-3 java程序 2-4 java类库组织结构和文档 2-5 java虚拟机简介 2-6 java的垃圾回收器 2-7 java上机练习 3-1 java语言基础入门 3-2 数据的分类 3-3 标识符、关键字和常量 3-4 运算符 3-5 表达式 3-6 顺序结构和选择结构 3-7 循环语句 3-8 跳转语句 3-9 MyEclipse工具介绍 3-10 java基础知识章节练习 4-1 一维数组 4-2 数组应用 4-3 多维数组 4-4 排序算法 4-5 增强for循环 4-6 数组和排序算法章节练习 5-0 抽象和封装 5-1 面向过程的设计思想 5-2 面向对象的设计思想 5-3 抽象 5-4 封装 5-5 属性 5-6 方法的定义 5-7 this关键字 5-8 javaBean 5-9 包 package 5-10 抽象和封装章节练习 6-0 继承和多态 6-1 继承 6-2 object类 6-3 多态 6-4 访问修饰符 6-5 static修饰符 6-6 final修饰符 6-7 abstract修饰符 6-8 接口 6-9 继承和多态 章节练习 7-1 面向对象的分析与设计简介 7-2 对象模型建立 7-3 类之间的关系 7-4 软件的可维护与复用设计原则 7-5 面向对象的设计与分析 章节练习 8-1 内部类与包装器 8-2 对象包装器 8-3 装箱和拆箱 8-4 练习题 9-1 常用类介绍 9-2 StringBuffer和String Builder类 9-3 Rintime类的使用 9-4 日期类简介 9-5 java程序国际化的实现 9-6 Random类和Math类 9-7 枚举 9-8 练习题 10-1 java异常处理 10-2 认识异常 10-3 使用try和catch捕获异常 10-4 使用throw和throws引发异常 10-5 finally关键字 10-6 getMessage和printStackTrace方法 10-7 异常分类 10-8 自定义异常类 10-9 练习题 11-1 Java集合框架和泛型机制 11-2 Collection接口 11-3 Set接口实现类 11-4 List接口实现类 11-5 Map接口 11-6 Collections类 11-7 泛型概述 11-8 练习题 12-1 多线程 12-2 线程的生命周期 12-3 线程的调度和优先级 12-4 线程的同步 12-5 集合类的同步问题 12-6 用Timer类调度任务 12-7 练习题 13-1 Java IO 13-2 Java IO原理 13-3 流类的结构 13-4 文件流 13-5 缓冲流 13-6 转换流 13-7 数据流 13-8 打印流 13-9 对象流 13-10 随机存取文件流 13-11 zip文件流 13-12 练习题 14-1 图形用户界面设计 14-2 事件处理机制 14-3 AWT常用组件 14-4 swing简介 14-5 可视化开发swing组件 14-6 声音的播放和处理 14-7 2D图形的绘制 14-8 练习题 15-1 反射 15-2 使用Java反射机制 15-3 反射与动态代理 15-4 练习题 16-1 Java标注 16-2 JDK内置的基本标注类型 16-3 自定义标注类型 16-4 对标注进行标注 16-5 利用反射获取标注信息 16-6 练习题 17-1 顶目实战1-单机版五子棋游戏 17-2 总体设计 17-3 代码实现 17-4 程序的运行与发布 17-5 手动生成可执行JAR文件 17-6 练习题 18-1 Java数据库编程 18-2 JDBC类和接口 18-3 JDBC操作SQL 18-4 JDBC基本示例 18-5 JDBC应用示例 18-6 练习题 19-1 。。。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值