BVB Source Codes

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

Return Download Jie Yang v0.6.3 article system: download hyperlink.htm Source code - Download Jie Yang v0.6.3 article system Source code - Type:.htm
  1. <HTML>
  2. <HEAD>
  3. <META content="text/html; charset=gb2312" http-equiv=Content-Type>
  4.  
  5. <style type="text/css">
  6. body, a, table, div, span, td, th, input, select{font:9pt;font-family: "宋体", Verdana, Arial, Helvetica, sans-serif;}
  7. body {padding:5px}
  8. </style>
  9.  
  10. <Script Language=JavaScript src="dialog.js"></script><Script Language=JavaScript>
  11. var sAction = URLParams['action'];
  12. var sTitle = "插入";
  13.  
  14. var objWindow;
  15.  
  16. var oRange;
  17. var sType;
  18. var oSel;
  19.  
  20. var sUrl = "http://";
  21. var sProtocol = "http://";
  22. var sTarget = "";
  23.  
  24. switch (sAction){
  25. case "other":
  26.         sUrl = dialogArguments.objLink.Href;
  27.         sTarget = dialogArguments.objLink.Target;
  28.         sProtocol = getProtocol(sUrl);
  29.         objWindow = dialogArguments.opener;
  30.         break;
  31. default:
  32.         oRange = dialogArguments.eWebEditor.document.selection.createRange();
  33.         sType = dialogArguments.eWebEditor.document.selection.type;
  34.  
  35.         if (sType == "Control") {
  36.                 oSel = oRange(0).parentNode;
  37.         }else{
  38.                 oSel = oRange.parentElement();
  39.         }
  40.  
  41.         if (oSel.tagName.toUpperCase() == "A"){
  42.                 sTarget = oSel.target;
  43.                 sUrl = oSel.getAttribute("href",2);
  44.                 sProtocol = getProtocol(sUrl);
  45.         }
  46.         objWindow = dialogArguments;
  47.         break;
  48. }
  49.  
  50.  
  51.  
  52.  
  53. // 从地址取协议
  54. function getProtocol(url){
  55.         var re=/(.+:\/*)(.*)/gi;
  56.         return url.replace(re,"$1");
  57. }
  58.  
  59. // 改变协议
  60. function changeProtocol(index){
  61.         sProtocol=d_protocol.options[index].value;
  62.         sUrl = d_url.value;
  63.         var re = /(.+:\/*)/gi;
  64.         sUrl = sUrl.replace(re, "");
  65.         d_url.value = sProtocol + sUrl;
  66. }
  67.  
  68.  
  69. // 初始值
  70. function InitDocument(){
  71.         SearchSelectValue(d_protocol, sProtocol.toLowerCase());
  72.         SearchSelectValue(d_target, sTarget.toLowerCase());
  73.         getAnchors();
  74.         d_url.value = sUrl;
  75. }
  76.  
  77. // 取所有的锚
  78. function getAnchors() {
  79.         d_anchor.options.length = 1;
  80.         var allLinks = objWindow.eWebEditor.document.body.getElementsByTagName("A");
  81.         for (i=0; i < allLinks.length; i++) {
  82.                 if (allLinks[i].href.toUpperCase() == "") {
  83.                         d_anchor.options[d_anchor.options.length] = new Option(allLinks[i].name,"#"+allLinks[i].name);
  84.                 }
  85.         }
  86. }
  87.  
  88. </script><title>超级链接属性</title>
  89.  
  90. <SCRIPT event=onclick for=Ok language=JavaScript>
  91.         sUrl = d_url.value;
  92.         sProtocol = d_protocol.options[d_protocol.selectedIndex].value;
  93.         sTarget = d_target.options[d_target.selectedIndex].value;
  94.  
  95.         if (sUrl != ""){
  96.                 switch (sAction){
  97.                 case "other":
  98.                         var arr = new Array();
  99.                         arr[0] = sUrl;
  100.                         arr[1] = sTarget;
  101.                         window.returnValue = arr;
  102.                         break;
  103.                 default:
  104.                         oRange.execCommand("CreateLink",false,sUrl);
  105.  
  106.                         oRange = dialogArguments.eWebEditor.document.selection.createRange();
  107.                         sType = dialogArguments.eWebEditor.document.selection.type;
  108.  
  109.                         if (sType == "Control") {
  110.                                 oSel = oRange(0).parentNode;
  111.                         }else{
  112.                                 oSel = oRange.parentElement();
  113.                         }
  114.  
  115.                         if (sTarget != ""){
  116.                                 oSel.target = sTarget;
  117.                         }else{
  118.                                 oSel.removeAttribute("target");
  119.                         }
  120.                         window.returnValue = null;
  121.                         break;
  122.                 }
  123.         } else {
  124.                 alert("链接地址不能为空");
  125.                 d_url.focus();
  126.                 return;
  127.         }
  128.         window.close();
  129. </script></HEAD>
  130.  
  131. <body bgcolor=menu onload="InitDocument()">
  132.  
  133. <table border=0 cellpadding=0 cellspacing=0 align=center>
  134. <tr>
  135.         <td>
  136.         <fieldset>
  137.         <legend>超级链接信息</legend>
  138.         <table border=0 cellpadding=0 cellspacing=0>
  139.         <tr><td colspan=9 height=5></td></tr>
  140.         <tr>
  141.                 <td width=7></td>
  142.                 <td noWrap>链接类型:</td>
  143.                 <td width=5></td>
  144.                 <td><select id=d_protocol style="width:72px" onchange="changeProtocol(this.selectedIndex)">
  145.                                 <option value=''>其它</option>
  146.                                 <option value='file://'>file:</option>
  147.                                 <option value='ftp://'>ftp:</option>
  148.                                 <option value='gopher://'>gopher:</option>
  149.                                 <option value='http://'>http:</option>
  150.                                 <option value='https://'>https:</option>
  151.                                 <option value='mailto:'>mailto:</option>
  152.                                 <option value='news:'>news:</option>
  153.                                 <option value='telnet:'>telnet:</option>
  154.                                 <option value='wais:'>wais:</option>
  155.                                 </select></td>
  156.                 <td width=40></td>
  157.                 <td noWrap>链接目标:</td>
  158.                 <td width=5></td>
  159.                 <td><select id=d_target style="width:72px"><option value=''>默认(无)</option><option value='_self'>相同框架</option><option value='_top'>整页</option><option value='_blank'>新建窗口</option><option value='_parent'>父框架</option></select></td>
  160.                 <td width=7></td>
  161.         </tr>
  162.         <tr><td colspan=9 height=5></td></tr>
  163.         <tr>
  164.                 <td width=7></td>
  165.                 <td>链接地址:</td>
  166.                 <td width=5></td>
  167.                 <td colspan=5><input type=text id=d_url size=38 value="" style="width:243px"></td>
  168.                 <td width=7></td>
  169.         </tr>
  170.         <tr><td colspan=9 height=5></td></tr>
  171.         <tr>
  172.                 <td width=7></td>
  173.                 <td>书签链接:</td>
  174.                 <td width=5></td>
  175.                 <td colspan=5><select id=d_anchor onchange="d_url.value=this.options[this.selectedIndex].value"><option value=''>默认(无)</option></select></td>
  176.                 <td width=7></td>
  177.         </tr>
  178.         <tr><td colspan=9 height=5></td></tr>
  179.         </table>
  180.         </fieldset>
  181.         </td>
  182. </tr>
  183. <tr><td height=5></td></tr>
  184. <tr><td align=right><input type=submit value='  确定  ' id=Ok>&nbsp;&nbsp;<input type=button value='  取消  ' onclick="window.close();"></td></tr>
  185. </table>
  186.  
  187. </BODY>
  188.  
  189.  
  190.  
downloadhyperlink.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