edit.js
上传用户:yjkj1008
上传日期:2020-10-17
资源大小:1496k
文件大小:7k
源码类别:

电子政务应用

开发平台:

HTML/CSS

  1. function fortable()
  2. {
  3.   var arr = showModalDialog("table1.html", "", "dialogWidth:25em; dialogHeight:12em; status:0");
  4.   if (arr != null){
  5.   var tmp=arr.split("*");
  6.   row=tmp[0];
  7.   col=tmp[1];
  8.   var string;
  9.   string="<table style='WIDTH: "+tmp[2]+"px;' border="+tmp[3]+" bgcolor="+tmp[6]+" cellspacing="+tmp[5]+" cellpadding="+tmp[4]+">";
  10.   for(i=1;i<=row;i++){
  11.   string=string+"<tr>";
  12.   for(j=1;j<=col;j++){
  13.   string=string+"<td>&nbsp;</td>";
  14.   }
  15.   string=string+"</tr>";
  16.   }
  17.   string=string+"</table>";
  18.   content=message.document.body.innerHTML;
  19.   content=content+string;
  20.   message.document.body.innerHTML=content;
  21.   }
  22.   else message.focus();
  23. }
  24. function swf()
  25. {
  26.   var arr = showModalDialog("flash.html", "", "dialogWidth:30em; dialogHeight:10em; status:0;help:0");
  27.   
  28.   if (arr != null){
  29.   var ss;
  30.   ss=arr.split("*")
  31.   path=ss[0];
  32.   row=ss[1];
  33.   col=ss[2];
  34.   var string;
  35. string="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width="+row+" height="+col+"><param name=movie value="+path+"><param name=quality value=high><embed src="+path+" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+row+" height="+col+"></embed></object>"
  36.   content=message.document.body.innerHTML;
  37.   content=content+string;
  38.    message.document.body.innerHTML=content;
  39.   }
  40.   else message.focus();
  41. }
  42. function wmv()
  43. {
  44.   var arr = showModalDialog("media.html", "", "dialogWidth:30em; dialogHeight:10em; status:0;help:0");
  45.   
  46.   if (arr != null){
  47.   var ss;
  48.   ss=arr.split("*")
  49.   path=ss[0];
  50.   row=ss[1];
  51.   col=ss[2];
  52.   var string;
  53. string="<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width="+row+" height="+col+"><param name=Filename value="+path+"><param name='BufferingTime' value='5'><param name='AutoSize' value='-1'><param name='AnimationAtStart' value='-1'><param name='AllowChangeDisplaySize' value='-1'><param name='ShowPositionControls' value='0'><param name='TransparentAtStart' value='1'><param name='ShowStatusBar' value='1'></object>"
  54.   content=message.document.body.innerHTML;
  55.   content=content+string;
  56.    message.document.body.innerHTML=content;
  57.   }
  58.   else message.focus();
  59. }
  60. function rm()
  61. {
  62.   var arr = showModalDialog("rm.html", "", "dialogWidth:30em; dialogHeight:10em; status:0;help:0");
  63.   
  64.   if (arr != null){
  65.   var ss;
  66.   ss=arr.split("*")
  67.   path=ss[0];
  68.   row=ss[1];
  69.   col=ss[2];
  70.   var string;
  71. string="<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width="+row+" height="+col+"><param name='CONTROLS' value='ImageWindow'><param name='CONSOLE' value='Clip1'><param name='AUTOSTART' value='-1'><param name=src value="+path+"></object><br><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'  width="+row+" height=60><param name='CONTROLS' value='ControlPanel,StatusBar'><param name='CONSOLE' value='Clip1'></object>"
  72.   content=message.document.body.innerHTML;
  73.   content=content+string;
  74.    message.document.body.innerHTML=content;
  75.   }
  76.   else message.focus();
  77. }
  78. function pic()
  79. {
  80.   var arr = showModalDialog("pic.html", "", "dialogWidth:30em; dialogHeight:15em; status:0;help:0");
  81.   
  82.   if (arr != null){
  83.   var ss;
  84.   ss=arr.split("*")
  85.   a=ss[0];
  86.   b=ss[1];
  87.   c=ss[2];
  88.   d=ss[3];
  89.   e=ss[4];
  90.   f=ss[5];
  91.   g=ss[6];
  92.   h=ss[7];
  93.   i=ss[8];
  94.   
  95.   var str1;
  96. str1="<img src='"+a+"' alt='"+b+"'"
  97. if(d.value!='')str1=str1+"width='"+d+"'"
  98. if(e.value!='')str1=str1+"height='"+e+"' "
  99. str1=str1+" border='"+i+"' align='"+h+"' vspace='"+f+"' hspace='"+g+"'  style='"+c+"'"
  100. str1=str1+">"
  101.   content=message.document.body.innerHTML;
  102.   content=content+str1;
  103.    message.document.body.innerHTML=content;
  104.   }
  105.   else message.focus();
  106. }
  107. function FIELDSET()
  108. {
  109.   var arr = showModalDialog("fieldset.htm", "", "dialogWidth:25em; dialogHeight:10em; status:0;help:0");
  110.   
  111.   if (arr != null){
  112.   var ss;
  113.   ss=arr.split("*")
  114.   a=ss[0];
  115.   b=ss[1];
  116.   c=ss[2];
  117.   d=ss[3];
  118.   var str1;
  119. str1="<FIELDSET "
  120. str1=str1+"align="+a+""
  121. str1=str1+" style='"
  122. if(c.value!='')str1=str1+"color:"+c+";"
  123. if(d.value!='')str1=str1+"background-color:"+d+";"
  124. str1=str1+"'><Legend"
  125. str1=str1+" align="+b+""
  126. str1=str1+">标题</Legend>内容</FIELDSET>"
  127.   content=message.document.body.innerHTML;
  128.   content=content+str1;
  129.    message.document.body.innerHTML=content;
  130.   }
  131.   else message.focus();
  132. }
  133. function iframe()
  134. {
  135.   var arr = showModalDialog("iframe.htm", "", "dialogWidth:30em; dialogHeight:13em; status:0;help:0");
  136.   
  137.   if (arr != null){
  138.   var ss;
  139.   ss=arr.split("*")
  140.   a=ss[0];
  141.   b=ss[1];
  142.   c=ss[2];
  143.   d=ss[3];
  144.   e=ss[4];
  145.   f=ss[5];
  146.   g=ss[6];
  147.   var str1;
  148. str1="<iframe src='"+a+"'"
  149. str1+=" scrolling="+b+""
  150. str1+=" frameborder="+c+""
  151. if(d!='')str1+=" marginheight="+d
  152. if(e!='')str1+=" marginwidth="+e
  153. if(f!='')str1+=" width="+f
  154. if(g!='')str1+=" height="+g
  155. str1=str1+"></iframe>"
  156.   content=message.document.body.innerHTML;
  157.   content=content+str1;
  158.    message.document.body.innerHTML=content;
  159.   }
  160.   else message.focus();
  161. }
  162. function hr()
  163. {
  164.   var arr = showModalDialog("hr.htm", "", "dialogWidth:30em; dialogHeight:12em; status:0;help:0");
  165.   
  166.   if (arr != null){
  167.   var ss;
  168.   ss=arr.split("*")
  169.   a=ss[0];
  170.   b=ss[1];
  171.   c=ss[2];
  172.   d=ss[3];
  173.   e=ss[4];
  174.   var str1;
  175. str1="<hr"
  176. str1=str1+" color='"+a+"'"
  177. str1=str1+" size="+b+"'"
  178. str1=str1+" "+c+""
  179. str1=str1+" align="+d+""
  180. str1=str1+" width="+e
  181. str1=str1+">"
  182.   content=message.document.body.innerHTML;
  183.   content=content+str1;
  184.    message.document.body.innerHTML=content;
  185.   }
  186.   else message.focus();
  187. }
  188. function IsDigit()
  189. {
  190.   return ((event.keyCode >= 48) && (event.keyCode <= 57));
  191. }
  192. //Function to format text in the text box
  193. function FormatText(command, option){
  194.    frames.message.document.execCommand(command, true, option);
  195.    frames.message.focus();
  196. }
  197. //Function to add image
  198. function AddImage(){
  199. imagePath = prompt('请输入图片地址', 'http://');
  200. if ((imagePath != null) && (imagePath != "")){
  201. frames.message.document.execCommand('InsertImage', false, imagePath);
  202.    frames.message.focus();
  203. }
  204. frames.message.focus();
  205. }
  206. //Function to clear form
  207. function ResetForm(){
  208. if (window.confirm('确认要清空对话框内容?')){
  209.   frames.message.document.body.innerHTML = ''; 
  210.   return true;
  211.  } 
  212.  return false;
  213. }
  214. //Function to open pop up window
  215. function openWin(theURL,winName,features) {
  216.    window.open(theURL,winName,features);
  217. }
  218. function setMode(newMode)
  219. {
  220.   bTextMode = newMode;
  221.   var cont;
  222.   if (bTextMode) {
  223.     cleanHtml();
  224.     cleanHtml();
  225.     cont=message.document.body.innerHTML;
  226.     message.document.body.innerText=cont;
  227.   } else {
  228.     cont=message.document.body.innerText;
  229.     message.document.body.innerHTML=cont;
  230.   }
  231.   message.focus();
  232. }
  233. function cleanHtml()
  234. {
  235.   var fonts = message.document.body.all.tags("FONT");
  236.   var curr;
  237.   for (var i = fonts.length - 1; i >= 0; i--) {
  238.     curr = fonts[i];
  239.     if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;
  240.   }
  241. }
  242. function help()
  243. {
  244.     var helpmess;
  245.     helpmess="---------------填写帮助---------------rnrn"+
  246.          "1.请不要发表有危险性的脚本。rnrn"+
  247.          "2.如果要书写源代码,请选中rnrn"+
  248.          " 查看HTML源代码书写.rnrn"+
  249.          "3.需要你自己运行,才能看效果.rnrn"+
  250.          "4.如果书写js,尽量不要在这儿书写.rnrn";
  251.     alert(helpmess);
  252. }