귀차니즘 발동;;;
만들다가 귀차나서 내비둠
<!-- write.html -->
<form name="Fm" method=post onSubmit="javascript:return submitData('dhtml');" enctype=multipart/form-data action="" ><!-- 폼 -->
<table width=800 cellpadding=0 cellspacing=0 align=center>
<col width=70></col><col width=></col>
<tr align=left>
<td>
</td>
<td>
<input class=input_long name=subject type=text value=''><!-- 제목 -->
</td>
</tr>
<tr align=left>
<td valign=middle>
</td>
<td>
<select onchange="javascript:htmlEdit('fontname',this.value);">
<option>폰트</option>
<option value="굴림">굴림</option>
<option value="돋움">돋움</option>
<option value="궁서">궁서</option>
<option value="Courier New">Courier New </option>
<option value="Arial Black">Arial Black</option>
<option value="Impact">Impact </option>
</select>
<select onchange="javascript:htmlEdit('fontSize',this.value);">
<option>크기</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5pt>5</option>
</select>
<input type="button" value="B" onclick="htmlEdit('bold');">
<input type="button" value="i" onclick="htmlEdit('italic');">
<input type="button" value="U" onclick="htmlEdit('underline');">
<input type="button" value="Color" onclick="setForeColor();">
<input type="button" value="왼쪽정렬" onclick="htmlEdit('justifyleft');">
<input type="button" value="가운데정렬" onclick="htmlEdit('justifycenter');">
<input type="button" value="오른쪽" onclick="htmlEdit('justifyright');">
<input type="button" value="들여쓰기 줄이기" onclick="htmlEdit('outdent');">
<input type="button" value="들여쓰기 늘이기" onclick="htmlEdit('indent');">
<input type="button" value="점표시목록" onclick="htmlEdit('insertunorderedlist');">
<input type="button" value="숫자목록" onclick="htmlEdit('insertorderedlist');">
<input type="button" value="링크걸기" onclick="createLink();">
<input type="button" value="html" onclick="javascipt:if(this.value==null) { changeMode('html'); this.value=true } else { changeMode('dhtml'); this.value=null; }">
<div id="div_dhtml">
<iframe width=100% height=350 name=dhtml src="dhtml.php" frameborder=1></iframe>
</div>
<div id="div_textarea" style="display:none">
<textarea name="contents" style="width:100%;height:350px;"></textarea>
</div>
</td>
</tr>
<tr height=20 align=left valign=bottom>
<td valign=top>
</td>
<td>
<input class=input_long name=upload[] type=file><input type='hidden' name=uploadvalue[] >
<input type="button" value="이미지 넣기" onclick="javascript:return insertUpload(0);" >
<br>
</td>
</tr> <tr height=20 align=left valign=bottom>
<td valign=top>
</td>
<td>
<input class=input_long name=upload[] type=file><input type='hidden' name=uploadvalue[] >
<input type="button" value="이미지 넣기" onclick="javascript:return insertUpload(1);" >
<br>
</td>
</tr>
<tr align=left>
<td valign=middle>
</td>
<td>
<font class=txt_small_kr>
</font>
</td>
</tr>
<tr><td height=10 colspan=2></td></tr>
<tr><td height=1 colspan=2 background=./skin/default/images/h_line_gray.gif></td></tr>
<tr><td height=10 colspan=2></td></tr>
<tr align=left>
<td>
</td>
<td>
<center>
<input type="submit">
</center>
</td>
</tr>
</table>
</form>
<script language="javascript" src='webediter.js'></script>
<!-- write.html 끝 -->
<!-- dhtml.php-->
<html>
<title>
<head>
</head>
</title>
<style type="text/css">
<!--
BODY,TABLE,TR,TD,input,DIV,form,TEXTAREA,select,center,option,pre,blockquote {
font-size:9pt;
color:333333;
font-family:굴림;
line-height:160%;
letter-spacing:0px
}
A:link {color:333333;text-decoration:none;}
A:visited {color:333333;text-decoration:none;}
A:active {color:333333;text-decoration:none;}
A:hover {color:FF0000;text-decoration:none;}
-->
BODY
{
background:#ffffff;
scrollbar-face-color:#ffffff;
scrollbar-shadow-color:#999999;
scrollbar-highlight-color:#cccccc;
scrollbar-3dlight-color:#FFFFFF;
scrollbar-darkshadow-color:#cccccc;
scrollbar-base-color:#ffffff;
scrollbar-arrow-color:#ffffff;
}
</style>
<body leftmargin=2 topmargin=2>
<p>
</p>
</body>
</html>
<!-- dhtml.php 끝-->
<!-- webediter.js -->
/////////////////////////////////////////////
//BASIC EDIT FUNCTION
/////////////////////////////////////////////
function htmlEdit(excute,values)
{
dhtml.focus();
targetText = dhtml.document.selection.createRange();
if(values==null)
{
targetText.execCommand(excute);
}else{
targetText.execCommand(excute,"",values);
}
}
/////////////////////////////////////////////
//SET FORECOLOR FUNCTION
/////////////////////////////////////////////
function setForeColor()
{
var color = showModalDialog("./module/post_form_colorchart.php",0,"dialogHeight=350px;dialogWidth=350px; scrollbars=no; status=0; help=0");
if(color!=null)
{
dhtml.document.execCommand('ForeColor','',color);
}
dhtml.focus();
}
/////////////////////////////////////////////
//CREATE LINK
/////////////////////////////////////////////
function createLink()
{
dhtml.focus();
targetText = dhtml.document.selection.createRange();
targetText.execCommand('CreateLink',1,'');
}
/////////////////////////////////////////////
//INSERT FILE FUNCTION
/////////////////////////////////////////////
function insertUpload(i)
{
dhtml.focus();
targetPoint = dhtml.document.selection.createRange();
//CHECKING NULL
if(!document.Fm['upload[]'][i].value)
{
alert('먼저 업로드할 파일을 지정해주십시요');
return false;
}
//CHECKING FILE_EXTENSION;
var file_name = new Array();
file_name = document.Fm['upload[]'][i].value.split(".");
var extension= file_name[file_name.length-1];
//IMAGE FILE
if(extension=='gif' || extension=='jpg' || extension=='png' || extension=='bmp')
{
targetPoint.execCommand('insertimage',false,document.Fm['upload[]'][i].value);
return false;
}
//THE OTHER FILE TYPE
else
{
alert("이미지 파일만 삽입이 가능합니다.");
return false;
}
}
/////////////////////////////////////////////
//CHANGE EDIT MODE
/////////////////////////////////////////////
function changeMode(mode)
{
if(mode=='html')
{
Fm.contents.value=dhtml.document.body.innerHTML;
div_textarea.style.display='';
div_dhtml.style.display='none';
}else{
dhtml.document.body.innerHTML=Fm.contents.value;
div_dhtml.style.display='';
div_textarea.style.display='none';
}
}
/////////////////////////////////////////////
//SUNMIT CHECK FUNCTION
/////////////////////////////////////////////
function submitData(mode)
{
//CHECK NAME
if(document.Fm.name)
{
if(document.Fm.name.value=='')
{
alert('이름을 입력해주십시요');
document.Fm.name.focus();
return false;
}
}
//PASSWORD
if(document.Fm.password)
{
if(document.Fm.password.value=='')
{
alert('패스워드를 입력해주십시요');
document.Fm.password.focus();
return false;
}
}
//CHECK SUBJECT
var subject = document.Fm.subject;
if(!subject.value)
{
alert('제목을 입력해주십시요');
subject.focus();
return false;
}
/////////////////////////////////////////
//MODE==DHTML
/////////////////////////////////////////
if(mode=='dhtml')
{
//CHANGE LINK TARGET INTO _NEW
for(var i=0;i<dhtml.document.links.length;i++)
{
dhtml.document.links[i].target="_blank";
}
//UPLOAD VALUE FOR SUBSTITUTION
for(var i=0;i<document.Fm['upload[]'].length;i++)
{
document.Fm['uploadvalue[]'][i].value=document.Fm['upload[]'][i].value;
}
//CHANGE DHTMLFRAME INTO TEXTAREA.VALUE
Fm.contents.value=dhtml.document.body.innerHTML;
//CHECK CONTETNS
if(!Fm.contents.value)
{
alert('내용을 입력해주십시요');
return false;
}
}
/////////////////////////////////////////
//MODE==TEXTAREA
/////////////////////////////////////////
else
{
var contents = document.Fm.contents;
if(!contents.value)
{
alert('내용을 입력해주십시요');
Fm.contents.focus();
return false;
}
}
}
dhtml.document.designMode="On"; //IFRAME에 쓸수있게 만듬
<!-- webedter.js 끝-->
'마루아라는 개발쟁이 > ASP' 카테고리의 다른 글
게시판 글쓰기에 HTML EDIT 달기 (0) | 2022.12.07 |
---|---|
세션을 DB로 관리하기 + 쪽지 확인하기 (0) | 2022.12.07 |
같은 아이디로 동시접속 하는걸 방지하는 방법 (0) | 2022.12.06 |
강제종료시 로그아웃 및 중복로그인 체크 (0) | 2022.12.06 |
중복 로그인 처리 방법 (0) | 2022.12.06 |