BVB Source Codes

Jie Yang v0.6.3 article system Show anchor.htm Source code

Return Download Jie Yang v0.6.3 article system: download anchor.htm Source code - Download Jie Yang v0.6.3 article system Source code - Type:.htm
  1. <HTML>
  2. <HEAD>
  3. <TITLE>书签管理</TITLE>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <style type="text/css">
  6. body, a, table, div, span, td, th, input, select{font-size:9pt;font-family: "宋体", Verdana, Arial, Helvetica, sans-serif;}
  7. body {padding:5px}
  8. </style>
  9. <Script Language=JavaScript src="dialog.js"></script><script language="JavaScript">
  10. // 初始选定对象
  11. var oRange;
  12. var sType;
  13. var oSel;
  14.  
  15. var sName="";
  16.  
  17. oRange = dialogArguments.eWebEditor.document.selection.createRange();
  18. sType = dialogArguments.eWebEditor.document.selection.type;
  19. if (sType == "Control") {
  20.         oSel = oRange(0).parentNode;
  21. }else{
  22.         oSel = oRange.parentElement();
  23. }
  24.  
  25. if (oSel.tagName.toUpperCase() == "A"){
  26.         if (oSel.href.toUpperCase() == ""){
  27.                 sName = oSel.name;
  28.                 moveRange(oSel);
  29.         }
  30. }
  31.  
  32.  
  33.  
  34. // 初始值
  35. function InitDocument(){
  36.         d_anchor.value = sName;
  37.         getAnchors();
  38. }
  39.  
  40. // 取所有的锚
  41. function getAnchors() {
  42.         d_allanchor.options.length = 0;
  43.         var allLinks = dialogArguments.eWebEditor.document.body.getElementsByTagName("A");
  44.         for (i=0; i < allLinks.length; i++) {
  45.                 if (allLinks[i].href.toUpperCase() == "") {
  46.                         d_allanchor.options[d_allanchor.options.length] = new Option(allLinks[i].name, allLinks[i].name);
  47.                 }
  48.         }
  49. }
  50.  
  51. // 取指定名称的锚对象
  52. function getAnchorObj(str) {
  53.         var allLinks = dialogArguments.eWebEditor.document.body.getElementsByTagName("A");
  54.         for (i=0; i < allLinks.length; i++) {
  55.                 if (allLinks[i].href.toUpperCase() == "") {
  56.                         if (allLinks[i].name==str){
  57.                                 return allLinks[i];
  58.                         }
  59.                 }
  60.         }
  61.         return null;
  62. }
  63.  
  64. // 确定
  65. function OK(){
  66.         var sName = BaseTrim(d_anchor.value);
  67.         if (sName == ""){
  68.                 BaseAlert(d_anchor, "请输入书签名称!");
  69.                 return;
  70.         }
  71.  
  72.         oRange = dialogArguments.eWebEditor.document.selection.createRange();
  73.         sType = dialogArguments.eWebEditor.document.selection.type;
  74.         if (sType == "Control") {
  75.                 oSel = oRange(0).parentNode;
  76.         }else{
  77.                 oSel = oRange.parentElement();
  78.         }
  79.  
  80.         var bModify = false;
  81.         if (oSel.tagName.toUpperCase() == "A"){
  82.                 if (oSel.href.toUpperCase() == ""){
  83.                         oSel.name = sName;
  84.                         bModify = true;
  85.                 }
  86.         }
  87.         if (!bModify){
  88.                 var html="";
  89.                 if (sType == "Control") {
  90.                         oRange(0).outerHTML = "<a id=eWebEditor_TempElement_Anchor name=" + sName + ">" + oRange(0).outerHTML + "</a>";
  91.                 }else{
  92.                         oRange.pasteHTML("<a id=eWebEditor_TempElement_Anchor name=" + sName + ">" + oRange.htmlText + "</a>");
  93.                 }
  94.  
  95.                 var oTempElement = dialogArguments.eWebEditor.document.getElementById("eWebEditor_TempElement_Anchor");
  96.  
  97.                 if (dialogArguments.borderShown != "0") {
  98.                         oTempElement.runtimeStyle.borderBottom = "1px dashed #000000";
  99.                 }
  100.  
  101.                 oTempElement.removeAttribute("id");
  102.         }
  103.        
  104.         window.returnValue = null;
  105.         window.close();
  106. }
  107.  
  108. // 转到
  109. function doMove(){
  110.         var nIndex = d_allanchor.selectedIndex;
  111.         if (nIndex<0) {
  112.                 alert("请先选择一个书签!");
  113.                 return;
  114.         }
  115.         var sel = getAnchorObj(d_allanchor.options[nIndex].value);
  116.         if (sel){
  117.                 moveRange(sel);
  118.         }
  119. }
  120.  
  121. // 清除
  122. function doDel(){
  123.         var nIndex = d_allanchor.selectedIndex;
  124.         if (nIndex<0) {
  125.                 alert("请先选择一个书签!");
  126.                 return;
  127.         }
  128.         var sel = getAnchorObj(d_allanchor.options[nIndex].value);
  129.         if (sel){
  130.                 sel.outerHTML = sel.innerHTML;
  131.                 d_allanchor.options[nIndex] = null;
  132.         }
  133. }
  134.  
  135. // 选定指定元素的选区
  136. function moveRange(sel){
  137.         var rng = dialogArguments.eWebEditor.document.body.createTextRange();
  138.         rng.moveToElementText(sel);
  139.         rng.select();
  140. }
  141. </script></HEAD>
  142. <BODY bgcolor="menu" onload="InitDocument()">
  143. <TABLE CELLSPACING="0" cellpadding="5" border="0" align=center>
  144. <TR valign="top">
  145.         <TD align="left" nowrap>
  146.                 书签名称:<br>
  147.                 <INPUT TYPE=TEXT SIZE=20 id="d_anchor" style="width:150px;"><br>
  148.                 本页其它书签:<br>
  149.                 <select id="d_allanchor" size=8 style="width:150px;" onchange="d_anchor.value=this.options[this.selectedIndex].value;"></select>
  150.         </td>
  151.         <td>
  152.                 <input type=button style="width:80px;margin-top:15px" name="btnOK" onClick="OK()" value="确定"><br>
  153.                 <input type=button style="width:80px;margin-top:5px" name="btnCancel" onClick="window.close()" value="取消"><br>
  154.                 <input type=button style="width:80px;margin-top:60px" name="btnMove" onClick="doMove()" value="转到"><br>
  155.                 <input type=button style="width:80px;margin-top:5px" name="btnDel" onClick="doDel()" value="清除"><br>
  156.         </td>
  157. </tr>
  158. </table>
  159. </BODY>
  160.  
  161.  
  162.  
downloadanchor.htm Source code - Download Jie Yang v0.6.3 article system Source code
Related Source Codes/Software:
Jilin classification information release system v5.0 trial version - A ready-made classifieds site publishing system, h... 2016-09-21
Linyi CMS v6.5 market classification information - A. supply and demand information function: informa... 2016-09-21
Tesco discount net SQL version - And presentations, faster. 2016-09-21
- electronic enterprise website management system In a fully functional version - Super suitable for enterprise agents build a corpo... 2016-09-21
Rio mesh network hard disk system v3.0 - System functions: 1, increase the progress of Asp... 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
Pcook CMS bubble guest v3.0 SDCMS version - Developed by Asp+Access, and meet the needs of sma... 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top