BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show anchor.htm Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download anchor.htm Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.htm
  1. <HTML>
  2. <HEAD>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <script language=javascript src="dialog.js"></script>
  5. <link href='dialog.css' type='text/css' rel='stylesheet'>
  6. <TITLE>标签管理</TITLE>
  7.  
  8. <script language="javascript">
  9.  
  10. var oRange;
  11. var sType;
  12. var oSel;
  13.  
  14. var sName="";
  15.  
  16. oRange = dialogArguments.eWebEditor.document.selection.createRange();
  17. sType = dialogArguments.eWebEditor.document.selection.type;
  18. if (sType == "Control") {
  19.         oSel = oRange(0).parentNode;
  20. }else{
  21.         oSel = oRange.parentElement();
  22. }
  23.  
  24. if (oSel.tagName.toUpperCase() == "A"){
  25.         if (oSel.href.toUpperCase() == ""){
  26.                 sName = oSel.name;
  27.                 moveRange(oSel);
  28.         }
  29. }
  30.  
  31. function InitDocument(){
  32.         d_anchor.value = sName;
  33.         getAnchors();
  34.         adjustDialog();
  35. }
  36.  
  37. function getAnchors() {
  38.         d_allanchor.options.length = 0;
  39.         var allLinks = dialogArguments.eWebEditor.document.body.getElementsByTagName("A");
  40.         for (i=0; i < allLinks.length; i++) {
  41.                 if (allLinks[i].href.toUpperCase() == "") {
  42.                         d_allanchor.options[d_allanchor.options.length] = new Option(allLinks[i].name, allLinks[i].name);
  43.                 }
  44.         }
  45. }
  46.  
  47. function getAnchorObj(str) {
  48.         var allLinks = dialogArguments.eWebEditor.document.body.getElementsByTagName("A");
  49.         for (i=0; i < allLinks.length; i++) {
  50.                 if (allLinks[i].href.toUpperCase() == "") {
  51.                         if (allLinks[i].name==str){
  52.                                 return allLinks[i];
  53.                         }
  54.                 }
  55.         }
  56.         return null;
  57. }
  58.  
  59. function OK(){
  60.         var sName = BaseTrim(d_anchor.value);
  61.         if (sName == ""){
  62.                 BaseAlert(d_anchor, "请输入书签名称!");
  63.                 return;
  64.         }
  65.  
  66.         oRange = dialogArguments.eWebEditor.document.selection.createRange();
  67.         sType = dialogArguments.eWebEditor.document.selection.type;
  68.         if (sType == "Control") {
  69.                 oSel = oRange(0).parentNode;
  70.         }else{
  71.                 oSel = oRange.parentElement();
  72.         }
  73.  
  74.         var bModify = false;
  75.         if (oSel.tagName.toUpperCase() == "A"){
  76.                 if (oSel.href.toUpperCase() == ""){
  77.                         oSel.name = sName;
  78.                         bModify = true;
  79.                 }
  80.         }
  81.         if (!bModify){
  82.                 var html="";
  83.                 if (sType == "Control") {
  84.                         oRange(0).outerHTML = "<a id=eWebEditor_TempElement_Anchor name=" + sName + ">" + oRange(0).outerHTML + "</a>";
  85.                 }else{
  86.                         oRange.pasteHTML("<a id=eWebEditor_TempElement_Anchor name=" + sName + ">" + oRange.htmlText + "</a>");
  87.                 }
  88.  
  89.                 var oTempElement = dialogArguments.eWebEditor.document.getElementById("eWebEditor_TempElement_Anchor");
  90.  
  91.                 if (dialogArguments.borderShown != "0") {
  92.                         oTempElement.runtimeStyle.borderBottom = "1px dashed #000000";
  93.                 }
  94.  
  95.                 oTempElement.removeAttribute("id");
  96.         }
  97.        
  98.         window.returnValue = null;
  99.         window.close();
  100. }
  101.  
  102. function doMove(){
  103.         var nIndex = d_allanchor.selectedIndex;
  104.         if (nIndex<0) {
  105.                 alert("请先选择一个书签!");
  106.                 return;
  107.         }
  108.         var sel = getAnchorObj(d_allanchor.options[nIndex].value);
  109.         if (sel){
  110.                 moveRange(sel);
  111.         }
  112. }
  113.  
  114. function doDel(){
  115.         var nIndex = d_allanchor.selectedIndex;
  116.         if (nIndex<0) {
  117.                 alert("请先选择一个书签!");
  118.                 return;
  119.         }
  120.         var sel = getAnchorObj(d_allanchor.options[nIndex].value);
  121.         if (sel){
  122.                 sel.outerHTML = sel.innerHTML;
  123.                 d_allanchor.options[nIndex] = null;
  124.         }
  125. }
  126.  
  127. function moveRange(sel){
  128.         var rng = dialogArguments.eWebEditor.document.body.createTextRange();
  129.         rng.moveToElementText(sel);
  130.         rng.select();
  131. }
  132. </script>
  133.  
  134. </HEAD>
  135. <BODY onload="InitDocument()">
  136. <table border=0 cellpadding=0 cellspacing=5 id=tabDialogSize><tr><td>
  137.  
  138.  
  139. <TABLE CELLSPACING="0" cellpadding="5" border="0" align=center>
  140. <TR valign="top">
  141.         <TD noWrap align="left">
  142.                 书签名称:<br>
  143.                 <INPUT TYPE=TEXT SIZE=20 id="d_anchor" style="width:150px;"><br>
  144.                 本页其它书签:<br>
  145.                 <select id="d_allanchor" size=8 style="width:150px;" onchange="d_anchor.value=this.options[this.selectedIndex].value;"></select>
  146.         </td>
  147.         <td noWrap height="100%">
  148.                 <table border=0 cellpadding=0 cellspacing=0 height="100%">
  149.                 <tr>
  150.                         <td height="50%" valign=top>
  151.                         <input type=button style="width:80px;margin-top:15px" name="btnOK" onClick="OK()" value="确定"><br>
  152.                         <input type=button style="width:80px;margin-top:5px" name="btnCancel" onClick="window.close()" value="取消"><br>
  153.                         </td>
  154.                 </tr>
  155.                 <tr>
  156.                         <td height="50%" valign=bottom>
  157.                         <input type=button style="width:80px;" name="btnMove" onClick="doMove()" value="转到"><br>
  158.                         <input type=button style="width:80px;margin-top:5px" name="btnDel" onClick="doDel()" value="删除"><br>
  159.                         </td>
  160.                 </tr>
  161.                 </table>
  162.         </td>
  163. </tr>
  164. </table>
  165.  
  166.  
  167. </td></tr></table>
  168. </BODY>
  169. </HTML>
  170.  
downloadanchor.htm Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 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