懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5     <title></title>
6     <script type="text/javascript" src="../internal.js"></script>
7     <style type="text/css">
8         .warp {width: 320px;height: 153px;margin-left:5px;padding: 20px 0 0 15px;position: relative;}
9         #url {width: 290px; margin-bottom: 2px; margin-left: -6px; margin-left: -2px\9;*margin-left:0;_margin-left:0; }
10         .format span{display: inline-block; width: 58px;text-align: center; zoom:1;}
11         table td{padding:5px 0;}
12         #align{width: 65px;height: 23px;line-height: 22px;}
13     </style>
14 </head>
15 <body>
16 <div class="warp">
17         <table width="300" cellpadding="0" cellspacing="0">
18             <tr>
19                 <td colspan="2" class="format">
20                     <span><var id="lang_input_address"></var></span>
21                     <input style="width:200px" id="url" type="text" value=""/>
22                 </td>
23             </tr>
24             <tr>
25                 <td colspan="2" class="format"><span><var id="lang_input_width"></var></span><input style="width:200px" type="text" id="width"/> px</td>
26
27             </tr>
28             <tr>
29                 <td colspan="2" class="format"><span><var id="lang_input_height"></var></span><input style="width:200px" type="text" id="height"/> px</td>
30             </tr>
31             <tr>
32                 <td><span><var id="lang_input_isScroll"></var></span><input type="checkbox" id="scroll"/> </td>
33                 <td><span><var id="lang_input_frameborder"></var></span><input type="checkbox" id="frameborder"/> </td>
34             </tr>
35
36             <tr>
37                 <td colspan="2"><span><var id="lang_input_alignMode"></var></span>
38                     <select id="align">
39                         <option value=""></option>
40                         <option value="left"></option>
41                         <option value="right"></option>
42                     </select>
43                 </td>
44             </tr>
45         </table>
46 </div>
47 <script type="text/javascript">
48     var iframe = editor._iframe;
49     if(iframe){
50         $G("url").value = iframe.getAttribute("src")||"";
51         $G("width").value = iframe.getAttribute("width")||iframe.style.width.replace("px","")||"";
52         $G("height").value = iframe.getAttribute("height") || iframe.style.height.replace("px","") ||"";
53         $G("scroll").checked = (iframe.getAttribute("scrolling") == "yes") ? true : false;
54         $G("frameborder").checked = (iframe.getAttribute("frameborder") == "1") ? true : false;
55         $G("align").value = iframe.align ? iframe.align : "";
56     }
57     function queding(){
58         var  url = $G("url").value.replace(/^\s*|\s*$/ig,""),
59                 width = $G("width").value,
60                 height = $G("height").value,
61                 scroll = $G("scroll"),
62                 frameborder = $G("frameborder"),
63                 float = $G("align").value,
64                 newIframe = editor.document.createElement("iframe"),
65                 div;
66         if(!url){
67             alert(lang.enterAddress);
68             return false;
69         }
70         newIframe.setAttribute("src",/http:\/\/|https:\/\//ig.test(url) ? url : "http://"+url);
71         /^[1-9]+[.]?\d*$/g.test( width ) ? newIframe.setAttribute("width",width) : "";
72         /^[1-9]+[.]?\d*$/g.test( height ) ? newIframe.setAttribute("height",height) : "";
73         scroll.checked ?  newIframe.setAttribute("scrolling","yes") : newIframe.setAttribute("scrolling","no");
74         frameborder.checked ?  newIframe.setAttribute("frameborder","1",0) : newIframe.setAttribute("frameborder","0",0);
75         float ? newIframe.setAttribute("align",float) :  newIframe.setAttribute("align","");
76         if(iframe){
77             iframe.parentNode.insertBefore(newIframe,iframe);
78             domUtils.remove(iframe);
79         }else{
80             div = editor.document.createElement("div");
81             div.appendChild(newIframe);
82             editor.execCommand("inserthtml",div.innerHTML);
83         }
84         editor._iframe = null;
85         dialog.close();
86     }
87     dialog.onok = queding;
88     $G("url").onkeydown = function(evt){
89         evt = evt || event;
90         if(evt.keyCode == 13){
91             queding();
92         }
93     };
94     $focus($G( "url" ));
95
96 </script>
97 </body>
98 </html>