/!PHP/ZManual/js/edit.js
JavaScript | 292 lines | 202 code | 29 blank | 61 comment | 24 complexity | eff3e1d974f236f640d15ad0c7639834 MD5 | raw file
- /*
- '-----------------------------------------------
- '??: -----------------------------------------
- '??:20041010----------------------------------
- '??:????----------------------------------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function fortable()
- {
-
- var arr = showModalDialog("table.htm", "", "dialogWidth:250px; dialogHeight:200px; status:1;help:0");
- if (arr != null){
- var tmp=arr.split("*");
- row=tmp[0];
- col=tmp[1];
- var string;
- string="<table style='WIDTH: "+tmp[2]+"px;' border="+tmp[3]+" bgcolor="+tmp[6]+" cellspacing="+tmp[5]+" cellpadding="+tmp[4]+">";
- for(i=1;i<=row;i++){
- string=string+"<tr>";
- for(j=1;j<=col;j++){
- string=string+"<td> </td>";
- }
- string=string+"</tr>";
- }
- string=string+"</table>";
- content=monolith_article_body.document.body.innerHTML;
- content=content+string;
- monolith_article_body.document.body.innerHTML=content;
- }
- else monolith_article_body.focus();
- }
-
- /*
- '-----------------------------------------------
- '??:Zerolone----------------------------------
- '??:20041010----------------------------------
- '??:?????--------------------------------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function Allmedia()
- {
- var arr = showModalDialog("Media.htm", "", "dialogWidth:500px; dialogHeight:200px; status:1;help:0");
-
- if (arr != null){
- var ss;
- ss=arr.split("*")
- Code = ss[0];
- path = ss[1];
- row = ss[2];
- col = ss[3];
-
- var string;
- if (Code=="Flash")
- {
- string="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width="+row+" height="+col+"><param name='movie' value="+path+"><param name='quality' value='high'></object>";
- monolith_article_body.document.body.innerHTML += string;
- }
- else if (Code=="MediaPlayer")
- {
- 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>";
- monolith_article_body.document.body.innerHTML += string;
- }
- else if (Code=="RealPlayer")
- {
- 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>";
- monolith_article_body.document.body.innerHTML += string;
- }
- }
- else monolith_article_body.focus();
- }
-
- /*
- '-----------------------------------------------
- '??: -----------------------------------------
- '??:20041010----------------------------------
- '??:??????????????????------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function pic()
- {
- var arr = showModalDialog("InsertPic.php", "", "dialogWidth:510px; dialogHeight:392px; status:1;help:0");
-
- if (arr != null)
- {
- var ss;
- ss=arr.split("*");
- a=ss[0];
- b=ss[1];
- c=ss[2];
- d=ss[3];
- e=ss[4];
- f=ss[5];
- g=ss[6];
- h=ss[7];
- i=ss[8];
-
- if (a=="UpLoadPic")
- {
- monolith_article_body.document.body.innerHTML=monolith_article_body.document.body.innerHTML + b;
- }
- else
- {
- var str1;
- str1="<img src='"+a+"' alt='"+b+"'"
- if(d.value!='')str1=str1+"width='"+d+"'"
- if(e.value!='')str1=str1+"height='"+e+"' "
- str1=str1+" border='"+i+"' align='"+h+"' vspace='"+f+"' hspace='"+g+"' style='"+c+"'"
- str1=str1+">"
- // content=monolith_article_body.document.body.innerHTML;
- // content=content+str1;
- // monolith_article_body.document.body.innerHTML=content;
- monolith_article_body.document.body.innerHTML+=str1;
- }
- }
- else monolith_article_body.focus();
- }
-
- /*
- '-----------------------------------------------
- '??: -----------------------------------------
- '??:20041208----------------------------------
- '??:????????????News_Pic1---------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function Insertpic1()
- {
- var arr = showModalDialog("InsertPic1.php", "", "dialogWidth:510px; dialogHeight:360px; status:1;help:0");
- AddNewsForm.News_Pic1.value= arr;
- AddNewsForm.News_Pic1.focus();
- }
-
- function Insertpic2()
- {
- var arr = showModalDialog("InsertPic2.php", "", "dialogWidth:510px; dialogHeight:360px; status:1;help:0");
- AddNewsForm.News_Pic2.value= arr;
- AddNewsForm.News_Pic2.focus();
- }
-
- /*
- '-----------------------------------------------
- '??:Zerolone----------------------------------
- '??:20041208----------------------------------
- '??:????----------------------------------
- '??:ThePicUrl ????------------------------
- '-----------------------------------------------
- */
- function View(ThePicUrl)
- {
- ViewImg.src=ThePicUrl;
- Layer1.style.visibility = "visible";
- // Layer1.style.posLeft = screen.height/2;
- Layer1.style.posLeft = document.body.scrollLeft + event.clientX + 50;
- Layer1.style.posTop = document.body.scrollTop + event.clientY + 50;
- }
-
- /*
- '-----------------------------------------------
- '??:Zerolone----------------------------------
- '??:20041208----------------------------------
- '??:??????------------------------------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function HiddenLayer()
- {
- Layer1.style.visibility = "Hidden";
- ViewImg.src = "../images/LoadingPic.gif";
- }
-
- function setMode(newMode)
- {
- bTextMode = newMode;
- var cont;
- if (bTextMode) {
- cleanHtml();
- cleanHtml();
-
- cont=monolith_article_body.document.body.innerHTML;
- monolith_article_body.document.body.innerText=cont;
- } else {
- cont=monolith_article_body.document.body.innerText;
- monolith_article_body.document.body.innerHTML=cont;
- }
- monolith_article_body.focus();
- }
-
- function cleanHtml()
- {
- var fonts = monolith_article_body.document.body.all.tags("FONT");
- var curr;
- for (var i = fonts.length - 1; i >= 0; i--) {
- curr = fonts[i];
- if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;
- }
-
- }
-
- function Page()
- {
- var str1;
- str1="[---??---]";
- monolith_article_body.document.body.innerHTML+=str1;
- }
-
-
- function help()
- {
- var helpmess;
- helpmess="---------------????---------------\r\n\r\n"+
- "1.?????????????\r\n\r\n"+
- "2.????????????\r\n\r\n"+
- "???HTML?????.\r\n\r\n"+
- "3.???????,?????.\r\n\r\n"+
- "4.????js??????????.\r\n\r\n";
- alert(helpmess);
- }
-
- function insertcode()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#EFEFEF" bordercolor="#BDBABD" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="10"></td><td>[??????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();//? id ?obj??????????? ,??????
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
- function insertnote()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#FFFBE7" bordercolor="#BDBABD" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="26" valign="top"><img src="image/note.png" alt="??"></td><td>[????????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
- function insertimportant()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#FFFBE7" bordercolor="#BDBABD" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="26" valign="top"><img src="image/important.png" alt="??"></td><td>[????????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
- function inserttip()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#FFFBE7" bordercolor="#D6D3B5" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="26" valign="top"><img src="image/tip.png" alt="??"></td><td>[????????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
- function insertwarning()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#FFFBE7" bordercolor="#D6D3B5" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="26" valign="top"><img src="image/warning.png" alt="??"></td><td>[????????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
- function insertcaution()
- {
- var str1;
- str1='<table align="center" border="1" width="90%" bgcolor="#FFFBE7" bordercolor="#D6D3B5" cellspacing="0" cellpadding="0"><tr><td><table border="0" width="100%" cellspacing="5" cellpadding="5"><tr><td width="26" valign="top"><img src="image/caution.png" alt="??"></td><td>[????????]</td></tr></table></td></tr></table>';
- frames.monolith_article_body.focus();
- frames.monolith_article_body.document.selection.createRange().pasteHTML(str1) ;
- }
-
-
-
- //Function to format text in the text box
- function formattext(command, option){
-
- frames.monolith_article_body.document.execCommand(command, true, option);
- frames.monolith_article_body.focus();
- }
-
- /*
- '-----------------------------------------------
- '??:Discuz?----------------------------------
- '??:------------------------------------------
- '??:????----------------------------------
- '??:------------------------------------------
- '-----------------------------------------------
- */
- function runCode(obj) {
- var winname = window.open('', "_blank", '');
- winname.document.open('text/html', 'replace');
- winname.document.writeln(obj.value.replace(/t extarea/g, "textarea"));
- winname.document.close();
- }