cheditor5 추가
This commit is contained in:
19
plugin/editor/cheditor5/popup/color_picker.html
Normal file
19
plugin/editor/cheditor5/popup/color_picker.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/color_picker.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="color_picker_wrapper"></div>
|
||||
<div style="padding:10px 0px 2px 0px;"><span>현재 셀 색상:</span></div>
|
||||
<div id="show_color" style="height:20px;border:1px solid #000;margin:3px 0px 0px 0px;background-color:#fff"></div>
|
||||
<script type="text/javascript">drawColor("color_picker_wrapper");</script>
|
||||
<div class="spacer"></div>
|
||||
<div style="text-align:center" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
22
plugin/editor/cheditor5/popup/flash.html
Normal file
22
plugin/editor/cheditor5/popup/flash.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/flash.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flash-movie-source">
|
||||
<div style="margin-bottom: 10px;width: 562px">
|
||||
<span class="font-normal"><동영상 소스 코드> iframe 또는 object 태그를 입력하세요.</span>
|
||||
</div>
|
||||
<textarea name="embed" id="fm_embed" style="height:40px;width:99%"></textarea>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="flash-player-wrapper" id="fm_player"></div>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
plugin/editor/cheditor5/popup/flash/ImagePreview.swf
Normal file
BIN
plugin/editor/cheditor5/popup/flash/ImagePreview.swf
Normal file
Binary file not shown.
BIN
plugin/editor/cheditor5/popup/flash/chximage.swf
Normal file
BIN
plugin/editor/cheditor5/popup/flash/chximage.swf
Normal file
Binary file not shown.
23
plugin/editor/cheditor5/popup/google_map.html
Normal file
23
plugin/editor/cheditor5/popup/google_map.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="https://maps.google.com/maps/api/js?V=3&language=ko®ion=KR" type="text/javascript"></script>
|
||||
<script src="js/google_map.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body onload="initMap(5)">
|
||||
<div style="padding-left:10px">
|
||||
<span class="font-normal">찾을 주소: </span>
|
||||
<input type="text" name="address" id="fm_address" value="서울" />
|
||||
<span id="map_search"></span>
|
||||
<div class="font-normal" style="margin: 5px 0px 0px 58px;color:#666">찾으실 도로명 주소, 지번 또는 건물명을 입력하세요.</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div id="map_canvas" style="width:514px; height:322px;border:1px #666 solid;text-align:center;margin:0 auto"></div>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
15
plugin/editor/cheditor5/popup/icon.html
Normal file
15
plugin/editor/cheditor5/popup/icon.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/icon.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="iconBlock" class="content-outline" style="text-align: center"></div>
|
||||
<div id="buttonWrapper" class="bottom-status"></div>
|
||||
</body>
|
||||
</html>
|
||||
76
plugin/editor/cheditor5/popup/image.html
Normal file
76
plugin/editor/cheditor5/popup/image.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/imageupload.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/swfobject.js" type="text/javascript"></script>
|
||||
<script src="js/image.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploadWindow">
|
||||
<div id="container">
|
||||
<table style="border-spacing: 0;padding: 0;border:none; margin-bottom: 10px; border-collapse: collapse">
|
||||
<tr>
|
||||
<td style="width:93px;padding:0">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" style="vertical-align:middle" onclick="removeImages();" alt="" />
|
||||
</td>
|
||||
<td style="padding: 0px 0px 0px 3px">
|
||||
<div id="oFlashButton"></div>
|
||||
<span style="vertical-align: middle;font-size: 12px"> (사진을 드래그하여 순서를 바꿀 수 있습니다.)</span>
|
||||
<span style="right: 0; top:5px; position:absolute; margin-left:10px;;font-size: 12px"><span id="imageCount">0</span>장 / 최대 <span id="maxImageNum"></span>장 사진</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="imageListWrapper" class="imageListWrapper"></div>
|
||||
<div id="imageInfoBox">
|
||||
<div>
|
||||
<div class="imageInfoTitle"><span>사진 정보</span></div>
|
||||
<div style="text-align:left;font-size:9pt;margin-top:7px;line-height:1.4em; padding-left: 5px">
|
||||
<div>가로: <span id="selectedImageWidth">0</span></div>
|
||||
<div>세로: <span id="selectedImageHeight">0</span></div>
|
||||
<div>이름: <span id="selectedImageName">없음</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px">
|
||||
<div class="imageInfoTitle"><span>정렬</span></div>
|
||||
<form name="fm_alignment" id="id_alignment" style="display: inline;">
|
||||
<table style="margin:7px auto 10px auto;border:0;padding:0;border-spacing:0">
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_left.png" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="left" checked="checked" />
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_center.png" style="margin: 0px 5px" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="center" />
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_right.png" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="right" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top:5px;font-size: 12px">
|
||||
<input type="checkbox" name="para" value="1" checked="checked" />한줄에 한 장씩 넣기
|
||||
</div>
|
||||
<div style="margin-top:5px;font-size: 12px">
|
||||
<input type="checkbox" name="use_spacer" value="1" checked="checked" />사진 여백 넣기
|
||||
</div>
|
||||
<div style="text-align:center;margin-top:15px">
|
||||
<span style="font-size:12px;font-family:Malgun Gothic,dotum,tahoma;">(전체 사진에 적용됨)</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div style="text-align:center;top:348px;width:100%;position:absolute;" id="buttonWrapper"></div>
|
||||
</div>
|
||||
<div id="dragDropContent"></div>
|
||||
<div id="removeImageButton" class="removeButton" style="width:13px;height:13px"></div>
|
||||
<div id="insertionMarker"></div>
|
||||
</body>
|
||||
</html>
|
||||
82
plugin/editor/cheditor5/popup/image.html5.html
Normal file
82
plugin/editor/cheditor5/popup/image.html5.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/imageupload.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/image.html5.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploadWindow">
|
||||
<div id="container">
|
||||
<div style="margin: 0px 0px 10px 0px;">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
|
||||
alt="" style="vertical-align: middle" />
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple"
|
||||
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
|
||||
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
|
||||
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
|
||||
<span style="vertical-align: middle">(사진을 점선 안으로 끌어 놓을 수 있습니다.)</span>
|
||||
<span style="left:555px; top:5px;position:absolute;"><span id="imageCount">0</span>장 / 최대 <span id="maxImageNum"></span>장 사진</span>
|
||||
</div>
|
||||
<div id="imageListWrapper" class="imageListWrapperHtml5"></div>
|
||||
<div id="imageInfoBox">
|
||||
<div>
|
||||
<div class="imageInfoTitle"><span>크기 줄이기</span></div>
|
||||
<div style="text-align:left;font-size:12px;margin-top:7px;line-height:1.4em; padding-left: 5px">
|
||||
<div>
|
||||
<span style="vertical-align: middle">가로:</span>
|
||||
<select name="resizeSelectBox" id="idResizeSelectBox" style="font-size: 12px; vertical-align: middle"></select>
|
||||
<span style="vertical-align: middle">픽셀</span>
|
||||
<div style="margin-top: 5px; display:none" id="idUserInputWrapper">
|
||||
<span style="vertical-align: middle">입력:</span>
|
||||
<input type="text" maxlength="4"
|
||||
style="font-size: 12px; width:40px; vertical-align: middle" name="resizeWidth" id="idResizeWidth" />
|
||||
<span style="vertical-align: middle">픽셀</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px">사진 높이는 자동으로 설정됩니다.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px">
|
||||
<div class="imageInfoTitle"><span>정렬</span></div>
|
||||
<form name="fm_alignment" id="id_alignment" style="display: inline">
|
||||
<table style="margin:7px auto 10px auto;border:0;padding:0;border-spacing:0">
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_left.png" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="left" checked="checked" />
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_center.png" style="margin: 0px 5px" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="center" />
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<img src="../icons/image_align_right.png" alt="" /><br />
|
||||
<input type="radio" name="alignment" value="right" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top:5px;font-size: 12px">
|
||||
<input type="checkbox" name="para" value="1" checked="checked" />한줄에 한 장씩 넣기
|
||||
</div>
|
||||
<div style="margin-top:5px;font-size: 12px">
|
||||
<input type="checkbox" name="use_spacer" value="1" checked="checked" />사진 여백 넣기
|
||||
</div>
|
||||
<div style="text-align:center;margin-top:15px">
|
||||
<span style="font-size:12px;font-family:Malgun Gothic,dotum,tahoma;">(전체 사진에 적용됨)</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div style="text-align:center;top:348px;width:100%;position:absolute;" id="buttonWrapper"></div>
|
||||
</div>
|
||||
<div id="dragDropContent"></div>
|
||||
<div id="removeImageButton" class="removeButton" style="width:13px;height:13px"></div>
|
||||
<div id="insertionMarker"></div>
|
||||
</body>
|
||||
</html>
|
||||
34
plugin/editor/cheditor5/popup/image_url.html
Normal file
34
plugin/editor/cheditor5/popup/image_url.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/image_url.js" type="text/javascript"></script>
|
||||
<script src="js/AC_OETags.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align:center" id="oFlash"></div>
|
||||
<div id="imageSize" style="margin-bottom:3px;font-size:8pt;font-family:verdana;font-weight:bold;text-align:center">0 X 0</div>
|
||||
<div id="tmpImage"></div>
|
||||
<fieldset><legend><span class="font-normal">사진 URL</span></legend>
|
||||
<div style="padding:5px" id="inputOutline">
|
||||
<input type="text" name="imageUrl" id="fm_imageUrl" size="34" value="http://" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<div style="margin:10px 0px 10px 0px">
|
||||
<fieldset><legend><span class="font-normal">레이아웃</span></legend>
|
||||
<div style="padding:5px 0px 5px 5px; text-align:center">
|
||||
<form id="fm_align" name="align">
|
||||
<input type="radio" name="alignment" value="left" /><img src="../icons/image_align_left.png" width="16" height="16" alt="" style="vertical-align: middle" />
|
||||
<input type="radio" name="alignment" value="center" checked="checked" /><img src="../icons/image_align_center.png" width="16" height="16" alt="" style="vertical-align: middle" />
|
||||
<input type="radio" name="alignment" value="right" /><img src="../icons/image_align_right.png" width="16" height="16" alt="" style="vertical-align: middle" />
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
247
plugin/editor/cheditor5/popup/js/AC_OETags.js
Normal file
247
plugin/editor/cheditor5/popup/js/AC_OETags.js
Normal file
@ -0,0 +1,247 @@
|
||||
// Flash Player Version Detection - Rev 1.5
|
||||
// Detect Client Browser type
|
||||
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
||||
// Modified: chna@chcode.com
|
||||
|
||||
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
||||
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
||||
|
||||
function errMaxFileSize (MaxFileSize) {
|
||||
alert("선택하신 파일 크기가 너무 큽니다. 최대 전송 크기는 "+MaxFileSize+" MB 입니다.");
|
||||
}
|
||||
|
||||
function ControlVersion()
|
||||
{
|
||||
var version = 0;
|
||||
var axo;
|
||||
// var e;
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
version = "WIN 6,0,21,0";
|
||||
axo.AllowScriptAccess = "always";
|
||||
version = axo.GetVariable("$version");
|
||||
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = "WIN 3,0,18,0";
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
version = "WIN 2,0,0,11";
|
||||
} catch (e) {
|
||||
version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
function GetSwfVer(){
|
||||
var flashVer = -1;
|
||||
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
||||
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
||||
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
||||
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
||||
var descArray = flashDescription.split(" ");
|
||||
var tempArrayMajor = descArray[2].split(".");
|
||||
var versionMajor = tempArrayMajor[0];
|
||||
var versionMinor = tempArrayMajor[1];
|
||||
if ( descArray[3] != "" ) {
|
||||
tempArrayMinor = descArray[3].split("r");
|
||||
} else {
|
||||
tempArrayMinor = descArray[4].split("r");
|
||||
}
|
||||
var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
|
||||
flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
||||
}
|
||||
}
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
||||
else if ( isIE && isWin && !isOpera ) {
|
||||
flashVer = ControlVersion();
|
||||
}
|
||||
return flashVer;
|
||||
}
|
||||
|
||||
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
||||
{
|
||||
versionStr = GetSwfVer();
|
||||
if (versionStr == -1 ) {
|
||||
return false;
|
||||
} else if (versionStr != 0) {
|
||||
if(isIE && isWin && !isOpera) {
|
||||
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
||||
tempString = tempArray[1]; // "2,0,0,11"
|
||||
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
||||
} else {
|
||||
versionArray = versionStr.split(".");
|
||||
}
|
||||
var versionMajor = versionArray[0];
|
||||
var versionMinor = versionArray[1];
|
||||
var versionRevision = versionArray[2];
|
||||
|
||||
if (versionMajor > parseFloat(reqMajorVer)) {
|
||||
return true;
|
||||
}
|
||||
else if (versionMajor == parseFloat(reqMajorVer)) {
|
||||
if (versionMinor > parseFloat(reqMinorVer))
|
||||
return true;
|
||||
else if (versionMinor == parseFloat(reqMinorVer)) {
|
||||
if (versionRevision >= parseFloat(reqRevision))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_AddExtension(src, ext)
|
||||
{
|
||||
if (src.indexOf('?') != -1)
|
||||
return src.replace(/\?/, ext+'?');
|
||||
else
|
||||
return src + ext;
|
||||
}
|
||||
|
||||
function AC_Generateobj(objAttrs, params, embedAttrs)
|
||||
{
|
||||
var str = '';
|
||||
if (isIE && isWin && !isOpera)
|
||||
{
|
||||
str += '<object ';
|
||||
for (var i in objAttrs)
|
||||
str += i + '="' + objAttrs[i] + '" ';
|
||||
var breakpoint=true;
|
||||
for (var i in params) {
|
||||
if (breakpoint) str += '>';
|
||||
str += '<param name="' + i + '" value="' + params[i] + '" />';
|
||||
breakpoint = false;
|
||||
}
|
||||
str += '</object>';
|
||||
} else {
|
||||
str += '<embed ';
|
||||
for (var i in embedAttrs)
|
||||
str += i + '="' + embedAttrs[i] + '" ';
|
||||
str += '> </embed>';
|
||||
}
|
||||
|
||||
document.getElementById('oFlash').innerHTML = str;
|
||||
}
|
||||
|
||||
function chxupload_RUN() {
|
||||
var ret =
|
||||
AC_GetArgs
|
||||
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
, "application/x-shockwave-flash"
|
||||
);
|
||||
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
||||
}
|
||||
|
||||
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
||||
var ret = new Object();
|
||||
ret.embedAttrs = new Object();
|
||||
ret.params = new Object();
|
||||
ret.objAttrs = new Object();
|
||||
for (var i=0; i < args.length; i=i+2){
|
||||
var currArg = args[i].toLowerCase();
|
||||
|
||||
switch (currArg){
|
||||
case "classid":
|
||||
break;
|
||||
case "pluginspage":
|
||||
ret.embedAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "src":
|
||||
case "movie":
|
||||
args[i+1] = AC_AddExtension(args[i+1], ext);
|
||||
ret.embedAttrs["src"] = args[i+1];
|
||||
ret.params[srcParamName] = args[i+1];
|
||||
break;
|
||||
case "onafterupdate":
|
||||
case "onbeforeupdate":
|
||||
case "onblur":
|
||||
case "oncellchange":
|
||||
case "onclick":
|
||||
case "ondblClick":
|
||||
case "ondrag":
|
||||
case "ondragend":
|
||||
case "ondragenter":
|
||||
case "ondragleave":
|
||||
case "ondragover":
|
||||
case "ondrop":
|
||||
case "onfinish":
|
||||
case "onfocus":
|
||||
case "onhelp":
|
||||
case "onmousedown":
|
||||
case "onmouseup":
|
||||
case "onmouseover":
|
||||
case "onmousemove":
|
||||
case "onmouseout":
|
||||
case "onkeypress":
|
||||
case "onkeydown":
|
||||
case "onkeyup":
|
||||
case "onload":
|
||||
case "onlosecapture":
|
||||
case "onpropertychange":
|
||||
case "onreadystatechange":
|
||||
case "onrowsdelete":
|
||||
case "onrowenter":
|
||||
case "onrowexit":
|
||||
case "onrowsinserted":
|
||||
case "onstart":
|
||||
case "onscroll":
|
||||
case "onbeforeeditfocus":
|
||||
case "onactivate":
|
||||
case "onbeforedeactivate":
|
||||
case "ondeactivate":
|
||||
case "type":
|
||||
case "codebase":
|
||||
case "id":
|
||||
ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "width":
|
||||
case "height":
|
||||
case "align":
|
||||
case "vspace":
|
||||
case "hspace":
|
||||
case "class":
|
||||
case "title":
|
||||
case "accesskey":
|
||||
case "name":
|
||||
case "tabindex":
|
||||
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
default:
|
||||
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
||||
}
|
||||
}
|
||||
ret.objAttrs["classid"] = classid;
|
||||
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
||||
return ret;
|
||||
}
|
||||
92
plugin/editor/cheditor5/popup/js/color_picker.js
Normal file
92
plugin/editor/cheditor5/popup/js/color_picker.js
Normal file
@ -0,0 +1,92 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
var colour = ["ffffcc","ffcc66","ff9900","ffcc99","ff6633","ffcccc","cc9999","ff6699","ff99cc","ff66cc","ffccff","cc99cc","cc66ff","cc99ff","9966cc","ccccff","9999cc","3333ff","6699ff","0066ff","99ccff","66ccff","99cccc","ccffff","99ffcc","66cc99","66ff99","99ff99","ccffcc","33ff33","66ff00","ccff99","99ff00","ccff66","cccc66","ffffff",
|
||||
"ffff99","ffcc00","ff9933","ff9966","cc3300","ff9999","cc6666","ff3366","ff3399","ff00cc","ff99ff","cc66cc","cc33ff","9933cc","9966ff","9999ff","6666ff","3300ff","3366ff","0066cc","3399ff","33ccff","66cccc","99ffff","66ffcc","33cc99","33ff99","66ff66","99cc99","00ff33","66ff33","99ff66","99ff33","ccff00","cccc33","cccccc",
|
||||
"ffff66","ffcc33","cc9966","ff6600","ff3300","ff6666","cc3333","ff0066","ff0099","ff33cc","ff66ff","cc00cc","cc00ff","9933ff","6600cc","6633ff","6666cc","3300cc","0000ff","3366cc","0099ff","00ccff","339999","66ffff","33ffcc","00cc99","00ff99","33ff66","66cc66","00ff00","33ff00","66cc00","99cc66","ccff33","999966","999999",
|
||||
"ffff33","cc9900","cc6600","cc6633","ff0000","ff3333","993333","cc3366","cc0066","cc6699","ff33ff","cc33cc","9900cc","9900ff","6633cc","6600ff","666699","3333cc","0000cc","0033ff","6699cc","3399cc","669999","33ffff","00ffcc","339966","33cc66","00ff66","669966","00cc00","33cc00","66cc33","99cc00","cccc99","999933","666666",
|
||||
"ffff00","cc9933","996633","993300","cc0000","ff0033","990033","996666","993366","cc0099","ff00ff","990099","996699","660099","663399","330099","333399","000099","0033cc","003399","336699","0099cc","006666","00ffff","33cccc","009966","00cc66","339933","336633","33cc33","339900","669933","99cc33","666633","999900","333333",
|
||||
"cccc00","996600","663300","660000","990000","cc0033","330000","663333","660033","990066","cc3399","993399","660066","663366","330033","330066","333366","000066","000033","003366","006699","003333","336666","00cccc","009999","006633","009933","006600","003300","00cc33","009900","336600","669900","333300","666600","000000"],
|
||||
oEditor = null,
|
||||
setColor = null,
|
||||
button = [
|
||||
{ alt: '', img: 'cancel.gif', cmd: popupClose }
|
||||
];
|
||||
|
||||
function setShowColor() {
|
||||
var showColor = document.getElementById('show_color'),
|
||||
color = setColor.selectedCell.getAttribute('bgcolor');
|
||||
|
||||
if (color) {
|
||||
showColor.style.backgroundColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
oEditor.editArea.focus();
|
||||
oEditor.backupRange(oEditor.restoreRange());
|
||||
oEditor.clearStoredSelections();
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function getColor()
|
||||
{
|
||||
var color = this.getAttribute('bgColor');
|
||||
setColor.func(color);
|
||||
popupClose();
|
||||
}
|
||||
|
||||
function drawColor(el) {
|
||||
var table, tr, td, insideTable, k = 0, i, j, tr2, td2,
|
||||
onMouseOver = function () {
|
||||
this.className = 'colorCellMouseOver';
|
||||
},
|
||||
onMouseOut = function () {
|
||||
this.className = 'colorCellMouseOut';
|
||||
};
|
||||
|
||||
table = document.createElement('table');
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
table.align = 'center';
|
||||
tr = table.insertRow(0);
|
||||
td = tr.insertCell(0);
|
||||
td.style.backgroundColor = '#fff';
|
||||
|
||||
insideTable = document.createElement('table');
|
||||
insideTable.border = 0;
|
||||
insideTable.cellSpacing = 1;
|
||||
insideTable.cellPadding = 0;
|
||||
insideTable.align = 'center';
|
||||
|
||||
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
tr2 = insideTable.insertRow(i);
|
||||
for (j = 0; j < 36; j++) {
|
||||
td2 = tr2.insertCell(j);
|
||||
td2.setAttribute('bgColor', '#' + colour[k]);
|
||||
td2.className = 'colorCellMouseOut';
|
||||
td2.onclick = getColor;
|
||||
td2.appendChild(document.createTextNode('\u00a0'));
|
||||
td2.onmouseover = onMouseOver;
|
||||
td2.onmouseout = onMouseOut;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
td.appendChild(insideTable);
|
||||
document.getElementById(el).appendChild(table);
|
||||
}
|
||||
|
||||
function init(dialog, argv) {
|
||||
var dlg = new Dialog(this);
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
setColor = argv;
|
||||
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
setShowColor();
|
||||
}
|
||||
41
plugin/editor/cheditor5/popup/js/dialog.js
Normal file
41
plugin/editor/cheditor5/popup/js/dialog.js
Normal file
@ -0,0 +1,41 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
function Dialog(oEditor) {
|
||||
this.oEditor = oEditor;
|
||||
}
|
||||
|
||||
Dialog.prototype.setDialogCss = function () {
|
||||
var head = document.getElementsByTagName('head')[0],
|
||||
css = head.appendChild(document.createElement('link'));
|
||||
|
||||
css.setAttribute('type', 'text/css');
|
||||
css.setAttribute('rel', 'stylesheet');
|
||||
css.setAttribute('media', 'all');
|
||||
css.setAttribute('href', this.oEditor.config.cssPath + 'dialog.css');
|
||||
};
|
||||
|
||||
Dialog.prototype.setDialogHeight = function (height) {
|
||||
this.oEditor.dialog.style.height = (height || document.body.scrollHeight) + 'px';
|
||||
this.oEditor.cheditor.popupFrameWrapper.style.height = this.oEditor.dialog.style.height;
|
||||
};
|
||||
|
||||
Dialog.prototype.showButton = function (button) {
|
||||
var buttonUrl = this.oEditor.config.iconPath + 'button/',
|
||||
wrapper = document.getElementById('buttonWrapper'),
|
||||
i, img;
|
||||
|
||||
for (i = 0; i < button.length; i++) {
|
||||
img = new Image();
|
||||
img.alt = button[i].alt;
|
||||
|
||||
if (!this.oEditor.undefined(button[i].hspace)) {
|
||||
img.hspace = button[i].hspace;
|
||||
}
|
||||
|
||||
img.className = 'button';
|
||||
img.src = buttonUrl + button[i].img;
|
||||
img.onclick = button[i].cmd;
|
||||
wrapper.appendChild(img);
|
||||
}
|
||||
};
|
||||
95
plugin/editor/cheditor5/popup/js/flash.js
Normal file
95
plugin/editor/cheditor5/popup/js/flash.js
Normal file
@ -0,0 +1,95 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
var button = [
|
||||
{ alt : '', img : 'play.gif', cmd : doPlay },
|
||||
{ alt : '', img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : '', img : 'cancel.gif', cmd : popupClose }
|
||||
],
|
||||
oEditor = null,
|
||||
iframeSource = false;
|
||||
|
||||
function init(dialog) {
|
||||
var dlg = new Dialog(this);
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
|
||||
function doPlay()
|
||||
{
|
||||
var elem = oEditor.trimSpace(document.getElementById("fm_embed").value),
|
||||
embed = null, div = document.createElement('div'),
|
||||
pos, str, object, child, movieHeight, movieWidth, i, params = [];
|
||||
|
||||
elem = oEditor.trimSpace(elem);
|
||||
if (elem == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (elem.toLowerCase().indexOf("iframe") !== -1) {
|
||||
document.getElementById('fm_player').innerHTML = elem;
|
||||
iframeSource = true;
|
||||
return;
|
||||
}
|
||||
|
||||
pos = elem.toLowerCase().indexOf("embed");
|
||||
if (pos !== -1) {
|
||||
str = elem.substr(pos);
|
||||
pos = str.indexOf(">");
|
||||
div.innerHTML = "<" + str.substr(0, pos) + ">";
|
||||
embed = div.firstChild;
|
||||
} else {
|
||||
div.innerHTML = elem;
|
||||
object = div.getElementsByTagName('OBJECT')[0];
|
||||
if (object && object.hasChildNodes()) {
|
||||
child = object.firstChild;
|
||||
movieWidth = (isNaN(object.width) !== true) ? object.width : 320;
|
||||
movieHeight = (isNaN(object.height) !== true) ? object.height : 240;
|
||||
|
||||
do {
|
||||
if ((child.nodeName === 'PARAM') && (typeof child.name !== 'undefined') && (typeof child.value !== 'undefined')) {
|
||||
params.push({key: (child.name == 'movie') ? 'src' : child.name, val: child.value});
|
||||
}
|
||||
child = child.nextSibling;
|
||||
} while (child);
|
||||
|
||||
if (params.length > 0) {
|
||||
embed = document.createElement('embed');
|
||||
embed.setAttribute("width", movieWidth);
|
||||
embed.setAttribute("height", movieHeight);
|
||||
for (i = 0; i < params.length; i++) {
|
||||
embed.setAttribute(params[i].key, params[i].val);
|
||||
}
|
||||
embed.setAttribute("type", "application/x-shockwave-flash");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (embed !== null) {
|
||||
document.getElementById('fm_player').appendChild(embed);
|
||||
}
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
document.getElementById('fm_player').innerHTML = '';
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function doSubmit()
|
||||
{
|
||||
var source = String(oEditor.trimSpace(document.getElementById("fm_embed").value));
|
||||
if (source === '') {
|
||||
popupClose();
|
||||
}
|
||||
|
||||
if (iframeSource || source.indexOf("iframe") !== -1) {
|
||||
oEditor.insertHtmlPopup(source);
|
||||
} else {
|
||||
oEditor.insertFlash(source);
|
||||
}
|
||||
|
||||
document.getElementById('fm_player').innerHTML = '';
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
143
plugin/editor/cheditor5/popup/js/google_map.js
Normal file
143
plugin/editor/cheditor5/popup/js/google_map.js
Normal file
@ -0,0 +1,143 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
var oEditor = null,
|
||||
centerLat = 0,
|
||||
centerLng = 0,
|
||||
latlng = 0,
|
||||
setZoom = 14,
|
||||
marker_lat = 0,
|
||||
marker_lng = 0,
|
||||
mapType = "roadmap",
|
||||
map,
|
||||
mapWidth = 512,
|
||||
mapHeight = 320,
|
||||
panorama,
|
||||
panoramaVisible = false;
|
||||
|
||||
function doSubmit() {
|
||||
var mapImg = document.createElement("img"),
|
||||
panoramaPitch, panoramaHeading, panoramaZoom, panoramaPosition;
|
||||
|
||||
if (marker_lat === 0) {
|
||||
marker_lat = centerLat;
|
||||
}
|
||||
if (marker_lng === 0) {
|
||||
marker_lng = centerLng;
|
||||
}
|
||||
|
||||
mapImg.style.width = mapWidth + 'px';
|
||||
mapImg.style.height = mapHeight + 'px';
|
||||
mapImg.style.border = '1px #000 solid';
|
||||
mapImg.setAttribute("alt", "Google Map");
|
||||
mapImg.onload = function () {
|
||||
oEditor.insertHtmlPopup(mapImg);
|
||||
oEditor.setImageEvent(true);
|
||||
oEditor.popupWinClose();
|
||||
};
|
||||
|
||||
if (panoramaVisible) {
|
||||
panoramaPitch = panorama.getPov().pitch;
|
||||
panoramaHeading = panorama.getPov().heading;
|
||||
panoramaZoom = panorama.getPov().zoom;
|
||||
panoramaPosition = panorama.getPosition();
|
||||
|
||||
mapImg.src = "http://maps.googleapis.com/maps/api/streetview?location=" + panoramaPosition +
|
||||
"&pitch=" + panoramaPitch +
|
||||
"&heading=" + panoramaHeading +
|
||||
"&size=" + mapWidth + 'x' + mapHeight +
|
||||
"&zoom=" + panoramaZoom +
|
||||
"&sensor=false" +
|
||||
"®ion=KR";
|
||||
} else {
|
||||
mapImg.src = "http://maps.google.com/maps/api/staticmap?center=" + centerLat + ',' + centerLng +
|
||||
"&zoom=" + setZoom +
|
||||
"&size=" + mapWidth + 'x' + mapHeight +
|
||||
"&maptype=" + mapType +
|
||||
//"&markers=" + marker_lat + ',' + marker_lng +
|
||||
"&sensor=false" +
|
||||
"&language=ko" +
|
||||
"®ion=KR";
|
||||
}
|
||||
}
|
||||
|
||||
function searchAddress() {
|
||||
var address = document.getElementById('fm_address').value,
|
||||
geocoder = new google.maps.Geocoder();
|
||||
//var results, status;
|
||||
//var marker = new google.maps.Marker({ 'map': map, 'draggable': true });
|
||||
|
||||
geocoder.geocode({'address' : address},
|
||||
function (results, status) {
|
||||
if (status === google.maps.GeocoderStatus.OK) {
|
||||
centerLat = results[0].geometry.location.lat();
|
||||
centerLng = results[0].geometry.location.lng();
|
||||
latlng = new google.maps.LatLng(centerLat, centerLng);
|
||||
map.setCenter(latlng);
|
||||
map.setZoom(setZoom);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initMap(zoom) {
|
||||
var mapOptions = {
|
||||
zoom: zoom || setZoom,
|
||||
panControl: true,
|
||||
zoomControl: true,
|
||||
scaleControl: true,
|
||||
center: new google.maps.LatLng(37.566, 126.977),
|
||||
disableDefaultUI: false,
|
||||
streetViewControl: true,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
|
||||
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
|
||||
centerLat = map.getCenter().lat();
|
||||
centerLng = map.getCenter().lng();
|
||||
|
||||
google.maps.event.addListener(map, 'dragend', function () {
|
||||
centerLat = map.getCenter().lat();
|
||||
centerLng = map.getCenter().lng();
|
||||
});
|
||||
|
||||
google.maps.event.addListener(map, 'maptypeid_changed', function () {
|
||||
mapType = map.getMapTypeId();
|
||||
});
|
||||
|
||||
google.maps.event.addListener(map, 'zoom_changed', function () {
|
||||
centerLat = map.getCenter().lat();
|
||||
centerLng = map.getCenter().lng();
|
||||
});
|
||||
|
||||
panorama = map.getStreetView();
|
||||
google.maps.event.addListener(panorama, 'visible_changed', function () {
|
||||
panoramaVisible = panorama.getVisible();
|
||||
});
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var dlg = new Dialog(oEditor),
|
||||
button = [
|
||||
{ alt : "", img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose }
|
||||
],
|
||||
buttonUrl = oEditor.config.iconPath + 'button/map_address.gif',
|
||||
search = new Image();
|
||||
|
||||
dlg.showButton(button);
|
||||
|
||||
search.src = buttonUrl;
|
||||
search.onclick = function () {
|
||||
searchAddress();
|
||||
};
|
||||
search.className = 'button';
|
||||
document.getElementById('map_search').appendChild(search);
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
54
plugin/editor/cheditor5/popup/js/icon.js
Normal file
54
plugin/editor/cheditor5/popup/js/icon.js
Normal file
@ -0,0 +1,54 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
var oEditor = null;
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function insertIcon() {
|
||||
this.removeAttribute("className");
|
||||
this.removeAttribute("class");
|
||||
this.style.margin = '1px 4px';
|
||||
oEditor.insertHtmlPopup(this.cloneNode(false));
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function showContents() {
|
||||
var block = document.getElementById('iconBlock'),
|
||||
path = oEditor.config.iconPath + 'em/',
|
||||
num = 80, i, br, img;
|
||||
|
||||
for (i = 40; i < num; i++) {
|
||||
if (i > 40 && (i % 10) === 0) {
|
||||
br = document.createElement('br');
|
||||
block.appendChild(br);
|
||||
}
|
||||
|
||||
img = new Image();
|
||||
img.src = path + (i + 1) + ".gif";
|
||||
img.style.width = '16px';
|
||||
img.style.height = '16px';
|
||||
img.style.margin = '5px 4px';
|
||||
img.style.verticalAlign = 'middle';
|
||||
img.setAttribute('alt', 'Emotion Icon');
|
||||
img.setAttribute('border', "0");
|
||||
img.className = 'handCursor';
|
||||
img.onclick = insertIcon;
|
||||
block.appendChild(img);
|
||||
}
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
var button, dlg;
|
||||
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
button = [{ alt : "", img : 'cancel.gif', cmd : popupClose }];
|
||||
|
||||
dlg = new Dialog(oEditor);
|
||||
showContents();
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
1344
plugin/editor/cheditor5/popup/js/image.html5.js
Normal file
1344
plugin/editor/cheditor5/popup/js/image.html5.js
Normal file
File diff suppressed because it is too large
Load Diff
890
plugin/editor/cheditor5/popup/js/image.js
Normal file
890
plugin/editor/cheditor5/popup/js/image.js
Normal file
@ -0,0 +1,890 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
var uploadScript = '',
|
||||
deleteScript = '',
|
||||
AppID = 'chximage',
|
||||
AppSRC = '',
|
||||
activeImage = null,
|
||||
destinationObject = null,
|
||||
readyToMove = false,
|
||||
moveTimer = -1,
|
||||
dragDropDiv,
|
||||
insertionMarker,
|
||||
offsetX_marker = -4,
|
||||
offsetY_marker = -3,
|
||||
geckoOffsetX_marker = 4,
|
||||
geckoOffsetY_marker = -2,
|
||||
divXPositions = [],
|
||||
divYPositions = [],
|
||||
divWidth = [],
|
||||
divHeight = [],
|
||||
tmpLeft = 0,
|
||||
tmpTop = 0,
|
||||
eventDiff_x = 0,
|
||||
eventDiff_y = 0,
|
||||
modifyImages = [],
|
||||
uploadMaxNumber = 12,
|
||||
imageCompleted = 0,
|
||||
imageCompletedList = [],
|
||||
uploadButton = '',
|
||||
uploadImagePath = '',
|
||||
showThumbnailSize = { width: 120, height: 90 },
|
||||
oEditor = null,
|
||||
button,
|
||||
imageResizeWidth = 0,
|
||||
makeThumbnail = true,
|
||||
makeThumbnailWidth = 120,
|
||||
makeThumbnailHeight = 90,
|
||||
sortOnName = false,
|
||||
browser = null;
|
||||
|
||||
function createInsertionMaker() {
|
||||
var wrapper = document.getElementById('insertionMarker'),
|
||||
topIco = new Image(),
|
||||
middleIco = new Image(),
|
||||
bottomIco = new Image();
|
||||
|
||||
topIco.src = uploadImagePath + '/marker_top.gif';
|
||||
topIco.style.width = '6px';
|
||||
topIco.style.height = '1px';
|
||||
wrapper.appendChild(topIco);
|
||||
|
||||
middleIco.src = uploadImagePath + '/marker_middle.gif';
|
||||
middleIco.style.height = '96px';
|
||||
middleIco.style.width = '6px';
|
||||
wrapper.appendChild(middleIco);
|
||||
|
||||
bottomIco.src = uploadImagePath + '/marker_bottom.gif';
|
||||
bottomIco.style.width = '6px';
|
||||
bottomIco.style.height = '1px';
|
||||
wrapper.appendChild(bottomIco);
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
swfobject.removeSWF(AppID);
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function showContents() {
|
||||
var spacer = function (id) {
|
||||
var clear = document.createElement('span');
|
||||
clear.style.height = '0';
|
||||
clear.style.width = '0';
|
||||
clear.className = 'clear';
|
||||
clear.id = 'spacer' + id;
|
||||
return clear;
|
||||
}, spacerNo = 1, i, imgBox, theImg, lastSpacer;
|
||||
|
||||
for (i = 0; i < uploadMaxNumber; i++) {
|
||||
if (i > 0 && ((i % 4) === 0)) {
|
||||
document.getElementById('imageListWrapper').appendChild(spacer(spacerNo++));
|
||||
}
|
||||
|
||||
imgBox = document.createElement('div');
|
||||
imgBox.id = 'imgBox' + i;
|
||||
imgBox.className = 'imageBox';
|
||||
theImg = document.createElement('div');
|
||||
theImg.id = 'img_' + i;
|
||||
theImg.className = 'imageBox_theImage';
|
||||
imgBox.appendChild(theImg);
|
||||
|
||||
document.getElementById('imageListWrapper').appendChild(imgBox);
|
||||
if (i === (uploadMaxNumber - 1)) {
|
||||
lastSpacer = spacer(spacerNo);
|
||||
lastSpacer.style.height = "7px";
|
||||
document.getElementById('imageListWrapper').appendChild(lastSpacer);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.msie && browser.ver < 7) {
|
||||
document.getElementById('imageListWrapper').style.padding = '5px 2px 5px 2px';
|
||||
document.getElementById('imageInfoBox').style.height = '302px';
|
||||
document.getElementById('imageInfoBox').style.width = '124px';
|
||||
} else {
|
||||
document.getElementById('imageListWrapper').style.padding = '5px 7px 0 5px';
|
||||
document.getElementById('imageInfoBox').style.height = '298px';
|
||||
document.getElementById('imageInfoBox').style.width = '130px';
|
||||
}
|
||||
}
|
||||
|
||||
function openFiles() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var elem = browser.msie ? document.getElementById(AppID) : document[AppID];
|
||||
elem.AddFiles();
|
||||
}
|
||||
|
||||
function setImageCount() {
|
||||
imageCompleted++;
|
||||
document.getElementById('imageCount').innerHTML = imageCompleted;
|
||||
}
|
||||
|
||||
function getImageCount() {
|
||||
return imageCompleted;
|
||||
}
|
||||
|
||||
function allowedMaxImage() {
|
||||
return uploadMaxNumber - getImageCount();
|
||||
}
|
||||
|
||||
function getUploadedCount() {
|
||||
return document.getElementById('imageListWrapper').getElementsByTagName('img').length;
|
||||
}
|
||||
|
||||
function uploadedImageCount() {
|
||||
imageCompleted = getUploadedCount();
|
||||
document.getElementById('imageCount').innerHTML = imageCompleted;
|
||||
}
|
||||
|
||||
function uploadError(msg) {
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
function imageDelete(filePath) {
|
||||
var chximage = document.getElementById(AppID);
|
||||
chximage.ImageDelete(encodeURI(filePath));
|
||||
}
|
||||
|
||||
function getTopPos(inputObj) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var returnValue = inputObj.offsetTop;
|
||||
|
||||
inputObj = inputObj.offsetParent;
|
||||
while (inputObj) {
|
||||
if (inputObj.tagName.toLowerCase() !== 'html') {
|
||||
returnValue += (inputObj.offsetTop - inputObj.scrollTop);
|
||||
if (browser.msie) {
|
||||
returnValue += inputObj.clientTop;
|
||||
}
|
||||
}
|
||||
inputObj = inputObj.offsetParent;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
function getLeftPos(inputObj) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var returnValue = inputObj.offsetLeft;
|
||||
|
||||
inputObj = inputObj.offsetParent;
|
||||
while (inputObj) {
|
||||
if (inputObj.id !== 'imageListWrapper') {
|
||||
returnValue += inputObj.offsetLeft;
|
||||
if (browser.msie) {
|
||||
returnValue += inputObj.clientLeft;
|
||||
}
|
||||
}
|
||||
inputObj = inputObj.offsetParent;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
function getDivCoordinates() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var imgBox = document.getElementById('imageListWrapper').getElementsByTagName('DIV'),
|
||||
i = 0;
|
||||
|
||||
for (; i < imgBox.length; i++) {
|
||||
if ((imgBox[i].className === 'imageBox' || imgBox[i].className === 'imageBoxHighlighted') && imgBox[i].id) {
|
||||
divXPositions[imgBox[i].id] = getLeftPos(imgBox[i]);
|
||||
divYPositions[imgBox[i].id] = getTopPos(imgBox[i]);
|
||||
divWidth[imgBox[i].id] = imgBox[i].offsetWidth;
|
||||
divHeight[imgBox[i].id] = imgBox[i].offsetHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reOrder() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var wrapper = document.getElementById('imageListWrapper'),
|
||||
imgBox = wrapper.getElementsByTagName('div'),
|
||||
imgNum = 0, i, spacer, breakline = [];
|
||||
|
||||
for (i = 0; i < imgBox.length; i++) {
|
||||
if (imgBox[i].id.indexOf('imgBox') === -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
imgBox[i].className = 'imageBox';
|
||||
imgBox[i].firstChild.className = 'imageBox_theImage';
|
||||
|
||||
if (imgNum > 0 && (imgNum % 4) === 0) {
|
||||
breakline.push(imgBox[i].id);
|
||||
}
|
||||
|
||||
imgNum++;
|
||||
}
|
||||
|
||||
for (i = 0; i < breakline.length; i++) {
|
||||
spacer = document.getElementById('spacer' + (i + 1));
|
||||
if (i + 1 === breakline.length) {
|
||||
wrapper.appendChild(spacer);
|
||||
} else {
|
||||
wrapper.insertBefore(spacer, document.getElementById(breakline[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setImageInfo(id) {
|
||||
var elem;
|
||||
if (!id) {
|
||||
document.getElementById('selectedImageWidth').innerHTML = '0';
|
||||
document.getElementById('selectedImageHeight').innerHTML = '0';
|
||||
document.getElementById('selectedImageName').innerHTML = "없음";
|
||||
} else {
|
||||
elem = imageCompletedList[id];
|
||||
document.getElementById('selectedImageWidth').innerHTML = elem.width;
|
||||
document.getElementById('selectedImageHeight').innerHTML = elem.height;
|
||||
document.getElementById('selectedImageName').innerHTML = elem.origName;
|
||||
}
|
||||
}
|
||||
|
||||
function showDelete() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var self = this, btn;
|
||||
|
||||
if (readyToMove) {
|
||||
return;
|
||||
}
|
||||
|
||||
getDivCoordinates();
|
||||
self.className = 'imageBox_theImage_over';
|
||||
btn = document.getElementById('removeImageButton');
|
||||
btn.style.left = (showThumbnailSize.width - parseInt(btn.style.width, 10) - 1) + 'px';
|
||||
btn.style.top = '-1px';
|
||||
|
||||
self.appendChild(btn);
|
||||
btn.style.display = 'block';
|
||||
|
||||
btn.onmouseover = function (ev) {
|
||||
ev = ev || window.event;
|
||||
ev.cancelBubble = true;
|
||||
this.style.display = 'block';
|
||||
setImageInfo(self.id);
|
||||
this.className = 'removeButton_over';
|
||||
self.className = 'imageBox_theImage_over';
|
||||
};
|
||||
btn.onmouseout = function () {
|
||||
this.className = 'removeButton';
|
||||
};
|
||||
btn.onmousedown = function () {
|
||||
var images = self.getElementsByTagName('img'), i, wrapper, moveobj, target;
|
||||
|
||||
for (i = 0; i < images.length; i++) {
|
||||
self.removeChild(images[i]);
|
||||
}
|
||||
|
||||
self.removeChild(self.firstChild);
|
||||
self.className = 'imageBox_theImage';
|
||||
|
||||
if (self.parentNode.nextSibling && self.parentNode.nextSibling.id) {
|
||||
wrapper = document.getElementById('imageListWrapper');
|
||||
moveobj = self.parentNode.nextSibling;
|
||||
target = self.parentNode;
|
||||
|
||||
while (moveobj !== null) {
|
||||
if (moveobj.firstChild && !moveobj.firstChild.firstChild) {
|
||||
break;
|
||||
}
|
||||
if (/^spacer/.test(moveobj.id)) {
|
||||
moveobj = moveobj.nextSibling;
|
||||
continue;
|
||||
}
|
||||
wrapper.insertBefore(moveobj, target);
|
||||
moveobj = target.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
reOrder();
|
||||
uploadedImageCount();
|
||||
setImageInfo(0);
|
||||
this.style.display = 'none';
|
||||
document.body.appendChild(this);
|
||||
self.onmouseout = self.onmouseover = null;
|
||||
};
|
||||
|
||||
setImageInfo(self.id);
|
||||
}
|
||||
|
||||
function hideDelete() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
document.getElementById('removeImageButton').style.display = 'none';
|
||||
}
|
||||
|
||||
function startUpload(count) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var el = document.getElementById('imageListWrapper').getElementsByTagName('div'), i, imgBox;
|
||||
|
||||
for (i = 0; i < el.length; i++) {
|
||||
imgBox = el[i];
|
||||
if (imgBox.className !== 'imageBox_theImage') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (count === 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!imgBox.firstChild || imgBox.firstChild.tagName.toLowerCase() !== 'img') {
|
||||
imgBox.style.backgroundImage = "url('" + uploadImagePath + "/loader.gif')";
|
||||
count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg, 그림 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
var resizeW, resizeH, M, elem;
|
||||
img.setAttribute("border", '0');
|
||||
|
||||
if (imgSize.width > showThumbnailSize.width || imgSize.height > showThumbnailSize.height) {
|
||||
if (imgSize.width > imgSize.height) {
|
||||
resizeW = (imgSize.width > showThumbnailSize.width) ? showThumbnailSize.width : imgSize.width;
|
||||
resizeH = Math.round((imgSize.height * resizeW) / imgSize.width);
|
||||
} else {
|
||||
resizeH = (imgSize.height > showThumbnailSize.height) ? showThumbnailSize.height : imgSize.height;
|
||||
resizeW = Math.round((imgSize.width * resizeH) / imgSize.height);
|
||||
}
|
||||
|
||||
if (resizeH > showThumbnailSize.height) {
|
||||
resizeH = (imgSize.height > showThumbnailSize.height) ? showThumbnailSize.height : imgSize.height;
|
||||
resizeW = Math.round((imgSize.width * resizeH) / imgSize.height);
|
||||
}
|
||||
|
||||
} else {
|
||||
resizeW = imgSize.width;
|
||||
resizeH = imgSize.height;
|
||||
}
|
||||
|
||||
img.style.width = resizeW - 2 + 'px';
|
||||
img.style.height = resizeH - 2 + 'px';
|
||||
img.style.margin = "1px";
|
||||
|
||||
if (resizeW < showThumbnailSize.width) {
|
||||
M = showThumbnailSize.width - resizeW;
|
||||
img.style.marginLeft = Math.round(M / 2) + 'px';
|
||||
}
|
||||
|
||||
if (resizeH < showThumbnailSize.height) {
|
||||
M = showThumbnailSize.height - resizeH;
|
||||
img.style.marginTop = Math.round(M / 2) + 'px';
|
||||
}
|
||||
|
||||
elem = document.getElementById(boxId);
|
||||
elem.style.backgroundImage = "url('" + uploadImagePath + "/dot.gif')";
|
||||
elem.onmouseover = showDelete;
|
||||
elem.onmouseout = function() {
|
||||
this.className = 'imageBox_theImage';
|
||||
setImageInfo(0);
|
||||
hideDelete();
|
||||
};
|
||||
|
||||
setImageCount();
|
||||
}
|
||||
|
||||
function uploadComplete(image) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var el = document.getElementById('imageListWrapper').getElementsByTagName('div'),
|
||||
imgBox = null, tmpImg, i, imgInfo,
|
||||
imgOnLoad = function () {
|
||||
imgInfo = { "width": image.width, "height": image.height, "fileSize": image.fileSize,
|
||||
"fileUrl": image.fileUrl, "fileName": image.fileName, "filePath": image.filePath, "origName": image.origName };
|
||||
|
||||
imageCompletedList[imgBox.id] = imgInfo;
|
||||
imgComplete(this, imgInfo, imgBox.id);
|
||||
};
|
||||
|
||||
image.filePath = decodeURI(image.filePath);
|
||||
image.origName = decodeURI(image.origName);
|
||||
|
||||
for (i = 0; i < el.length; i++) {
|
||||
imgBox = el[i];
|
||||
if (imgBox.className !== 'imageBox_theImage') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!imgBox.firstChild || imgBox.firstChild.tagName.toLowerCase() !== 'img') {
|
||||
tmpImg = new Image();
|
||||
tmpImg.style.width = "0px";
|
||||
tmpImg.style.height = "0px";
|
||||
tmpImg.setAttribute("alt", image.origName);
|
||||
tmpImg.onload = imgOnLoad;
|
||||
tmpImg.src = image.fileUrl;
|
||||
imgBox.appendChild(tmpImg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showUploadWindow() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var uploadWindow = document.getElementById("uploadWindow"),
|
||||
uploadWindowWidth = 700,
|
||||
winWidth, el, i, j, imgBox, img;
|
||||
|
||||
if (!(oEditor.undefined(window.innerWidth))) {
|
||||
winWidth = window.innerWidth;
|
||||
} else if (document.documentElement &&
|
||||
(!(oEditor.undefined(document.documentElement.clientWidth))) &&
|
||||
document.documentElement.clientWidth !== 0) {
|
||||
winWidth = document.documentElement.clientWidth;
|
||||
} else if (document.body && (!(oEditor.undefined(document.body.clientWidth)))) {
|
||||
winWidth = document.body.clientWidth;
|
||||
} else {
|
||||
alert('현재 브라우저를 지원하지 않습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
uploadWindow.style.left = winWidth / 2 - (uploadWindowWidth / 2) + 'px';
|
||||
uploadWindow.style.display = "block";
|
||||
uploadWindow.style.width = uploadWindowWidth + 'px';
|
||||
|
||||
if (modifyImages.length > 0) {
|
||||
el = document.getElementById('imageListWrapper').getElementsByTagName('div');
|
||||
for (i = 0; i < modifyImages.length; i++) {
|
||||
if (i > 7) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (j = 0; j < el.length; j++) {
|
||||
imgBox = el[j];
|
||||
if (imgBox.className !== 'imageBox_theImage') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (imgBox.firstChild && (imgBox.firstChild.src === modifyImages[i])) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (imgBox.firstChild === null) {
|
||||
img = new Image();
|
||||
img.src = modifyImages[i];
|
||||
img.border = 0;
|
||||
img.alt = '';
|
||||
img.style.width = '120px';
|
||||
img.style.height = '90px';
|
||||
imgBox.appendChild(img);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeImages() {
|
||||
var images = [], i, j, theImage, img, remove;
|
||||
document.body.appendChild(document.getElementById('removeImageButton'));
|
||||
|
||||
for (i = 0; i < uploadMaxNumber; i++) {
|
||||
theImage = document.getElementById('img_' + i);
|
||||
if (theImage.hasChildNodes() && theImage.firstChild.tagName.toLowerCase() === 'img') {
|
||||
images.push(theImage);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < images.length; i++) {
|
||||
img = images[i];
|
||||
if (img.firstChild !== null) {
|
||||
oEditor.removeEvent(img, 'mouseover', showDelete);
|
||||
remove = img.getElementsByTagName('img');
|
||||
|
||||
for (j = 0; j < remove.length; j++) {
|
||||
img.removeChild(remove[j]);
|
||||
}
|
||||
|
||||
img.parentNode.className = 'imageBox';
|
||||
oEditor.removeEvent(img, 'mouseover', showDelete);
|
||||
}
|
||||
}
|
||||
uploadedImageCount();
|
||||
imageCompletedList = [];
|
||||
}
|
||||
|
||||
function removeImage() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var i, theImage, found = false;
|
||||
|
||||
for (i = 0; i < uploadMaxNumber; i++) {
|
||||
theImage = document.getElementById('img_' + i);
|
||||
if (theImage.hasChildNodes() && theImage.firstChild.tagName.toLowerCase() === 'img') {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (!confirm('추가하신 사진이 있습니다. 사진 넣기를 취소하시겠습니까?')) {
|
||||
return false;
|
||||
}
|
||||
removeImages();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function closeWindow() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
if (removeImage()) {
|
||||
popupClose();
|
||||
}
|
||||
}
|
||||
|
||||
function cancelEvent() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
return false;
|
||||
}
|
||||
|
||||
function startMoveTimer() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var subElements, newDiv;
|
||||
|
||||
if (moveTimer >= 0 && moveTimer < 10) {
|
||||
moveTimer++;
|
||||
setTimeout('startMoveTimer()', 8);
|
||||
}
|
||||
|
||||
if (moveTimer === 5) {
|
||||
getDivCoordinates();
|
||||
subElements = dragDropDiv.getElementsByTagName('div');
|
||||
if (subElements.length > 0) {
|
||||
dragDropDiv.removeChild(subElements[0]);
|
||||
}
|
||||
|
||||
dragDropDiv.style.display = 'block';
|
||||
newDiv = activeImage.cloneNode(true);
|
||||
newDiv.className = 'imageBox';
|
||||
newDiv.style.opacity = 0.5;
|
||||
|
||||
newDiv.id = '';
|
||||
newDiv.style.padding = '2px';
|
||||
dragDropDiv.appendChild(newDiv);
|
||||
|
||||
dragDropDiv.style.top = tmpTop + 'px';
|
||||
dragDropDiv.style.left = tmpLeft + 'px';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getMouseButtn(e) {
|
||||
var code;
|
||||
e = e || window.event;
|
||||
code = e.button;
|
||||
|
||||
if (code) {
|
||||
if (browser.msie && browser.version < 9) {
|
||||
code = code === 1 ? 0 : (code === 4 ? 1 : code);
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
function selectImage(e) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var el = this.parentNode.firstChild.firstChild, obj;
|
||||
|
||||
if (!el) {
|
||||
return;
|
||||
}
|
||||
|
||||
e = e || window.event;
|
||||
if (getMouseButtn(e) === 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
obj = this.parentNode;
|
||||
hideDelete();
|
||||
|
||||
obj.className = 'imageBoxHighlighted';
|
||||
activeImage = obj;
|
||||
readyToMove = true;
|
||||
moveTimer = 0;
|
||||
|
||||
tmpLeft = e.clientX + Math.max(document.body.scrollLeft, document.documentElement.scrollLeft);
|
||||
tmpTop = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop);
|
||||
|
||||
startMoveTimer();
|
||||
return false;
|
||||
}
|
||||
|
||||
function dragDropEnd() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var parentObj, chkObj, turn = false;
|
||||
|
||||
readyToMove = false;
|
||||
moveTimer = -1;
|
||||
dragDropDiv.style.display = 'none';
|
||||
insertionMarker.style.display = 'none';
|
||||
|
||||
if (!activeImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (destinationObject && destinationObject !== activeImage) {
|
||||
parentObj = destinationObject.parentNode;
|
||||
chkObj = destinationObject.previousSibling;
|
||||
turn = false;
|
||||
|
||||
if (chkObj === null) {
|
||||
chkObj = document.getElementById('imageListWrapper').firstChild;
|
||||
turn = true;
|
||||
}
|
||||
|
||||
if (chkObj.id.indexOf('spacer') !== -1) {
|
||||
chkObj = chkObj.previousSibling;
|
||||
}
|
||||
|
||||
if (chkObj.firstChild.firstChild === null) {
|
||||
reOrder();
|
||||
return;
|
||||
}
|
||||
|
||||
if (chkObj && chkObj.id !== null) {
|
||||
while (chkObj) {
|
||||
if (chkObj.firstChild.firstChild !== null) {
|
||||
break;
|
||||
}
|
||||
chkObj = chkObj.previousSibling;
|
||||
}
|
||||
destinationObject = turn ? chkObj : chkObj.nextSibling;
|
||||
}
|
||||
|
||||
parentObj.insertBefore(activeImage, destinationObject);
|
||||
reOrder();
|
||||
|
||||
activeImage = null;
|
||||
destinationObject = null;
|
||||
getDivCoordinates();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
activeImage.className = 'imageBox';
|
||||
return true;
|
||||
}
|
||||
|
||||
function dragDropMove(e) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var elementFound = false, prop, offsetX, offsetY, leftPos, topPos, btnCode;
|
||||
|
||||
if (moveTimer === -1 || !readyToMove) {
|
||||
return;
|
||||
}
|
||||
|
||||
e = e || window.event;
|
||||
|
||||
leftPos = e.clientX + document.documentElement.scrollLeft - eventDiff_x;
|
||||
topPos = e.clientY + document.documentElement.scrollTop - eventDiff_y;
|
||||
|
||||
dragDropDiv.style.top = topPos + 'px';
|
||||
dragDropDiv.style.left = leftPos + 'px';
|
||||
|
||||
leftPos = leftPos + eventDiff_x;
|
||||
topPos = topPos + eventDiff_y;
|
||||
|
||||
if (getMouseButtn(e) !== 0) {
|
||||
dragDropEnd();
|
||||
}
|
||||
|
||||
for (prop in divXPositions) {
|
||||
if (!divXPositions.hasOwnProperty(prop) || divXPositions[prop].className === 'clear') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (divXPositions[prop] < leftPos &&
|
||||
(divXPositions[prop] + divWidth[prop] * 0.7) > leftPos &&
|
||||
divYPositions[prop] < topPos &&
|
||||
(divYPositions[prop] + divWidth[prop]) > topPos) {
|
||||
if (browser.msie) {
|
||||
offsetX = offsetX_marker;
|
||||
offsetY = offsetY_marker;
|
||||
} else {
|
||||
offsetX = geckoOffsetX_marker;
|
||||
offsetY = geckoOffsetY_marker;
|
||||
}
|
||||
|
||||
insertionMarker.style.top = divYPositions[prop] + offsetY + 'px';
|
||||
insertionMarker.style.left = divXPositions[prop] + offsetX + 'px';
|
||||
insertionMarker.style.display = 'block';
|
||||
destinationObject = document.getElementById(prop);
|
||||
elementFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!elementFound) {
|
||||
insertionMarker.style.display = 'none';
|
||||
destinationObject = null;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function saveImageOrder() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var rData = [],
|
||||
objects = document.getElementById('imageListWrapper').getElementsByTagName('div'),
|
||||
i;
|
||||
|
||||
for (i = 0; i < objects.length; i++) {
|
||||
if (objects[i].className === 'imageBox' ||
|
||||
objects[i].className === 'imageBoxHighlighted') {
|
||||
rData.push(objects[i].id);
|
||||
}
|
||||
}
|
||||
|
||||
return rData;
|
||||
}
|
||||
|
||||
function initGallery() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var imgBox = document.getElementById('imageListWrapper').getElementsByTagName('div'),
|
||||
i;
|
||||
|
||||
for (i = 0; i < imgBox.length; i++) {
|
||||
if (imgBox[i].className === 'imageBox_theImage') {
|
||||
imgBox[i].onmousedown = selectImage;
|
||||
}
|
||||
}
|
||||
|
||||
document.body.onselectstart = cancelEvent;
|
||||
document.body.ondragstart = cancelEvent;
|
||||
document.body.onmouseup = dragDropEnd;
|
||||
document.body.onmousemove = dragDropMove;
|
||||
|
||||
dragDropDiv = document.getElementById('dragDropContent');
|
||||
insertionMarker = document.getElementById('insertionMarker');
|
||||
getDivCoordinates();
|
||||
}
|
||||
|
||||
function doSubmit() {
|
||||
// ----------------------------------------------------------------------------------
|
||||
var el = document.getElementById('imageListWrapper').getElementsByTagName('div'),
|
||||
imageArray = [],
|
||||
num = 0,
|
||||
elem = document.getElementById('id_alignment').elements,
|
||||
imgParagraph = false,
|
||||
useSpacer = false,
|
||||
imgAlign = 'top', i, imgBox, input;
|
||||
|
||||
for (i = 0; i < elem.length; i++) {
|
||||
input = elem[i];
|
||||
switch (input.name) {
|
||||
case "alignment" :
|
||||
if (input.checked) {
|
||||
imgAlign = input.value;
|
||||
}
|
||||
break;
|
||||
case "para" :
|
||||
imgParagraph = input.checked;
|
||||
break;
|
||||
case "use_spacer" :
|
||||
useSpacer = input.checked;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < el.length; i++) {
|
||||
imgBox = el[i];
|
||||
if (imgBox.className !== "imageBox_theImage") {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (imgBox.firstChild !== null) {
|
||||
imageArray[num] = imageCompletedList[imgBox.id];
|
||||
|
||||
if (imgAlign === "break") {
|
||||
imageArray[num].alt = "break";
|
||||
} else {
|
||||
imageArray[num].alt = '';
|
||||
imageArray[num].align = imgAlign;
|
||||
}
|
||||
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
if (imageArray.length > 0) {
|
||||
oEditor.doInsertImage(imageArray, imgParagraph, useSpacer);
|
||||
}
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function initEvent() {
|
||||
var swfVersionStr = "11.1.0",
|
||||
xiSwfUrlStr = "http://get.adobe.com/kr/flashplayer/",
|
||||
flashvars = {
|
||||
UploadScript: uploadScript,
|
||||
DeleteScript: deleteScript,
|
||||
UploadButton: uploadButton,
|
||||
MakeThumbnail: makeThumbnail,
|
||||
ThumbnailWidth: makeThumbnailWidth,
|
||||
ThumbnailHeight: makeThumbnailHeight,
|
||||
ImageResizeWidth: imageResizeWidth,
|
||||
loadPolicyFile: true,
|
||||
SortOnName: sortOnName
|
||||
},
|
||||
params = {
|
||||
quality: "high",
|
||||
bgcolor: "#ffffff",
|
||||
allowscriptaccess: "Always",
|
||||
allowfullscreen: "false",
|
||||
//allowNetworking: "all",
|
||||
wmode: "transparent"
|
||||
},
|
||||
attributes = { id: AppID, name: AppID, align: "middle" };
|
||||
|
||||
swfobject.embedSWF(AppSRC, "oFlashButton", "93", "22", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
var dlg = new Dialog(this),
|
||||
elem = document.getElementById('id_alignment').elements,
|
||||
i;
|
||||
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
browser = oEditor.getBrowser();
|
||||
|
||||
uploadImagePath = oEditor.config.iconPath + 'imageUpload';
|
||||
uploadButton = '../icons/imageUpload/add.gif';
|
||||
AppSRC = oEditor.config.popupPath + 'flash/chximage.swf';
|
||||
uploadMaxNumber = oEditor.config.imgUploadNumber;
|
||||
uploadScript = oEditor.config.editorPath + 'imageUpload/upload.php';
|
||||
deleteScript = oEditor.config.editorPath + 'imageUpload/delete.php';
|
||||
|
||||
imageResizeWidth = oEditor.config.imgMaxWidth;
|
||||
makeThumbnail = oEditor.config.makeThumbnail;
|
||||
sortOnName = oEditor.config.imgUploadSortName;
|
||||
makeThumbnailWidth = oEditor.config.thumbnailWidth;
|
||||
makeThumbnailHeight = oEditor.config.thumbnailHeight;
|
||||
|
||||
document.getElementById("maxImageNum").appendChild(document.createTextNode(uploadMaxNumber));
|
||||
|
||||
button = [
|
||||
{ alt: "", img: 'submit.gif', cmd: doSubmit, hspace: 2 },
|
||||
{ alt: "", img: 'cancel.gif', cmd: closeWindow, hspace: 2 }
|
||||
];
|
||||
|
||||
dlg.setDialogHeight(370);
|
||||
dlg.showButton(button);
|
||||
showContents();
|
||||
initGallery();
|
||||
showUploadWindow();
|
||||
initEvent();
|
||||
createInsertionMaker();
|
||||
|
||||
for (i = 0; i < elem.length; i++) {
|
||||
if (elem[i].name === "alignment" && elem[i].value === oEditor.config.imgDefaultAlign) {
|
||||
elem[i].checked = "checked";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
279
plugin/editor/cheditor5/popup/js/image_upload_flash.js
Normal file
279
plugin/editor/cheditor5/popup/js/image_upload_flash.js
Normal file
@ -0,0 +1,279 @@
|
||||
// Flash Player Version Detection - Rev 1.6
|
||||
// Detect Client Browser type
|
||||
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
||||
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
||||
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
||||
|
||||
function ControlVersion()
|
||||
{
|
||||
var version = 0;
|
||||
var axo;
|
||||
// var e;
|
||||
|
||||
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
|
||||
|
||||
try {
|
||||
// version will be set for 7.X or greater players
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 6.X players only
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
|
||||
// installed player is some revision of 6.0
|
||||
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
|
||||
// so we have to be careful.
|
||||
|
||||
// default to the first public version
|
||||
version = "WIN 6,0,21,0";
|
||||
|
||||
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
|
||||
axo.AllowScriptAccess = "always";
|
||||
|
||||
// safe to call for 6.0r47 or greater
|
||||
version = axo.GetVariable("$version");
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 4.X or 5.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 3.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = "WIN 3,0,18,0";
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 2.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
version = "WIN 2,0,0,11";
|
||||
} catch (e) {
|
||||
version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
// JavaScript helper required to detect Flash Player PlugIn version information
|
||||
function GetSwfVer(){
|
||||
// NS/Opera version >= 3 check for Flash plugin in plugin array
|
||||
var flashVer = -1;
|
||||
|
||||
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
||||
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
||||
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
||||
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
||||
var descArray = flashDescription.split(" ");
|
||||
var tempArrayMajor = descArray[2].split(".");
|
||||
var versionMajor = tempArrayMajor[0];
|
||||
var versionMinor = tempArrayMajor[1];
|
||||
var versionRevision = descArray[3];
|
||||
if (versionRevision == "") {
|
||||
versionRevision = descArray[4];
|
||||
}
|
||||
if (versionRevision[0] == "d") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
} else if (versionRevision[0] == "r") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
if (versionRevision.indexOf("d") > 0) {
|
||||
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
|
||||
}
|
||||
} else if (versionRevision[0] == "b") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
}
|
||||
flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
||||
}
|
||||
}
|
||||
// MSN/WebTV 2.6 supports Flash 4
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
||||
// WebTV 2.5 supports Flash 3
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
||||
// older WebTV supports Flash 2
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
||||
else if ( isIE && isWin && !isOpera ) {
|
||||
flashVer = ControlVersion();
|
||||
}
|
||||
return flashVer;
|
||||
}
|
||||
|
||||
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
|
||||
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
||||
{
|
||||
versionStr = GetSwfVer();
|
||||
if (versionStr == -1 ) {
|
||||
return false;
|
||||
} else if (versionStr != 0) {
|
||||
if(isIE && isWin && !isOpera) {
|
||||
// Given "WIN 2,0,0,11"
|
||||
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
||||
tempString = tempArray[1]; // "2,0,0,11"
|
||||
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
||||
} else {
|
||||
versionArray = versionStr.split(".");
|
||||
}
|
||||
var versionMajor = versionArray[0];
|
||||
var versionMinor = versionArray[1];
|
||||
var versionRevision = versionArray[2];
|
||||
|
||||
// is the major.revision >= requested major.revision AND the minor version >= requested minor
|
||||
if (versionMajor > parseFloat(reqMajorVer)) {
|
||||
return true;
|
||||
} else if (versionMajor == parseFloat(reqMajorVer)) {
|
||||
if (versionMinor > parseFloat(reqMinorVer))
|
||||
return true;
|
||||
else if (versionMinor == parseFloat(reqMinorVer)) {
|
||||
if (versionRevision >= parseFloat(reqRevision))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_AddExtension(src, ext)
|
||||
{
|
||||
if (src.indexOf('?') != -1)
|
||||
return src.replace(/\?/, ext+'?');
|
||||
else
|
||||
return src + ext;
|
||||
}
|
||||
|
||||
function AC_Generateobj(objAttrs, params, embedAttrs)
|
||||
{
|
||||
if (isIE && isWin && !isOpera)
|
||||
{
|
||||
var str = '<object ';
|
||||
for (var i in objAttrs)
|
||||
str += i + '="' + objAttrs[i] + '" ';
|
||||
str += '>';
|
||||
for (var i in params)
|
||||
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
|
||||
str += '</object>';
|
||||
document.getElementById("oFlash").innerHTML = str;
|
||||
}
|
||||
else {
|
||||
var oFlash = document.getElementById("oFlash");
|
||||
var embed = document.createElement('embed');
|
||||
for (var i in embedAttrs) {
|
||||
embed.setAttribute(i, embedAttrs[i]);
|
||||
}
|
||||
oFlash.appendChild(embed);
|
||||
}
|
||||
}
|
||||
|
||||
function CHXImageRUN(){
|
||||
var ret =
|
||||
AC_GetArgs
|
||||
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
, "application/x-shockwave-flash"
|
||||
);
|
||||
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
||||
}
|
||||
|
||||
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
||||
var ret = new Object();
|
||||
ret.embedAttrs = new Object();
|
||||
ret.params = new Object();
|
||||
ret.objAttrs = new Object();
|
||||
for (var i=0; i < args.length; i=i+2){
|
||||
var currArg = args[i].toLowerCase();
|
||||
|
||||
switch (currArg){
|
||||
case "classid":
|
||||
break;
|
||||
case "pluginspage":
|
||||
ret.embedAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "src":
|
||||
case "movie":
|
||||
args[i+1] = AC_AddExtension(args[i+1], ext);
|
||||
ret.embedAttrs["src"] = args[i+1];
|
||||
ret.params[srcParamName] = args[i+1];
|
||||
break;
|
||||
case "onafterupdate":
|
||||
case "onbeforeupdate":
|
||||
case "onblur":
|
||||
case "oncellchange":
|
||||
case "onclick":
|
||||
case "ondblClick":
|
||||
case "ondrag":
|
||||
case "ondragend":
|
||||
case "ondragenter":
|
||||
case "ondragleave":
|
||||
case "ondragover":
|
||||
case "ondrop":
|
||||
case "onfinish":
|
||||
case "onfocus":
|
||||
case "onhelp":
|
||||
case "onmousedown":
|
||||
case "onmouseup":
|
||||
case "onmouseover":
|
||||
case "onmousemove":
|
||||
case "onmouseout":
|
||||
case "onkeypress":
|
||||
case "onkeydown":
|
||||
case "onkeyup":
|
||||
case "onload":
|
||||
case "onlosecapture":
|
||||
case "onpropertychange":
|
||||
case "onreadystatechange":
|
||||
case "onrowsdelete":
|
||||
case "onrowenter":
|
||||
case "onrowexit":
|
||||
case "onrowsinserted":
|
||||
case "onstart":
|
||||
case "onscroll":
|
||||
case "onbeforeeditfocus":
|
||||
case "onactivate":
|
||||
case "onbeforedeactivate":
|
||||
case "ondeactivate":
|
||||
case "type":
|
||||
case "codebase":
|
||||
ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "id":
|
||||
case "width":
|
||||
case "height":
|
||||
case "align":
|
||||
case "vspace":
|
||||
case "hspace":
|
||||
case "class":
|
||||
case "title":
|
||||
case "accesskey":
|
||||
case "name":
|
||||
case "tabindex":
|
||||
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
default:
|
||||
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
||||
}
|
||||
}
|
||||
ret.objAttrs["classid"] = classid;
|
||||
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
244
plugin/editor/cheditor5/popup/js/image_url.js
Normal file
244
plugin/editor/cheditor5/popup/js/image_url.js
Normal file
@ -0,0 +1,244 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
// Homepage: http://www.chcode.com
|
||||
// Copyright (c) 1997-2014 CHSOFT
|
||||
// ================================================================
|
||||
var AppWidth = "250";
|
||||
var AppHeight = "175";
|
||||
var AppID = "cheditorPreview";
|
||||
var oEditor = null;
|
||||
var button = [ { alt : "", img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose } ];
|
||||
var newImage = null;
|
||||
|
||||
function CHEditorImagePreview () {
|
||||
// ----------------------------------------------------------------------------------
|
||||
// callBack function
|
||||
|
||||
document.getElementById(AppID).CHEditorImagePreview("1", "1");
|
||||
}
|
||||
|
||||
function CHXUploadRUN(src) {
|
||||
// ----------------------------------------------------------------------------------
|
||||
// Preview
|
||||
//
|
||||
chxupload_RUN("src", src,
|
||||
"width", AppWidth,
|
||||
"height", AppHeight,
|
||||
"align", "middle",
|
||||
"id", AppID,
|
||||
"classid", AppID,
|
||||
"quality", "high",
|
||||
"bgcolor", "#ebe9ed",
|
||||
"name", AppID,
|
||||
"wmode", "transparent",
|
||||
"allowScriptAccess","Always",
|
||||
"type", "application/x-shockwave-flash",
|
||||
"pluginspage", "http://www.adobe.com/go/getflashplayer");
|
||||
}
|
||||
|
||||
function getFilename (file) {
|
||||
while (file.indexOf("/") != -1) {
|
||||
file = file.slice(file.indexOf("/") + 1);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
function popupClose()
|
||||
{
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function chkImgFormat (url)
|
||||
{
|
||||
var imageName = getFilename(url);
|
||||
var allowSubmit = false;
|
||||
var extArray = [".gif", ".jpg", ".jpeg", ".png"];
|
||||
|
||||
extArray.join(" ");
|
||||
if (imageName === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var ext = imageName.slice(imageName.lastIndexOf(".")).toLowerCase();
|
||||
var i;
|
||||
|
||||
for (i = 0; i < extArray.length; i++) {
|
||||
if (extArray[i] == ext) {
|
||||
allowSubmit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!allowSubmit) {
|
||||
alert("사진은 GIF, JPG, PNG 형식만 넣을 수 있습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return imageName;
|
||||
}
|
||||
|
||||
function previewImage (source) {
|
||||
if (navigator.appName.indexOf("microsoft") != -1) {
|
||||
window[AppID].CHEditorImagePreview(source, 0, 0);
|
||||
}
|
||||
else {
|
||||
document[AppID].CHEditorImagePreview(source, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function checkImageComplete (img) {
|
||||
if (img.complete != true) {
|
||||
setTimeout("checkImageComplete(document.getElementById('"+img.id+"'))", 250);
|
||||
}
|
||||
else {
|
||||
document.getElementById('imageSize').innerHTML = '';
|
||||
|
||||
newImage = new Image();
|
||||
newImage.style.width = img.width + 'px';
|
||||
newImage.style.height = img.height + 'px';
|
||||
newImage.setAttribute("src", img.src);
|
||||
newImage.setAttribute("alt", getFilename(img.src));
|
||||
}
|
||||
}
|
||||
|
||||
function doPreview () {
|
||||
var imgurl = document.getElementById('fm_imageUrl').value;
|
||||
var fileName = chkImgFormat(imgurl);
|
||||
if (!fileName) {
|
||||
return;
|
||||
}
|
||||
|
||||
var img = new Image();
|
||||
img.src = imgurl;
|
||||
img.id = fileName;
|
||||
|
||||
document.getElementById('tmpImage').appendChild(img);
|
||||
checkImageComplete(img);
|
||||
previewImage(img.src);
|
||||
}
|
||||
|
||||
function getElementById(id) {
|
||||
var el = null;
|
||||
try {
|
||||
el = document.getElementById(id);
|
||||
}
|
||||
catch (ignore) {}
|
||||
return el;
|
||||
}
|
||||
|
||||
function removeObjectInIE(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
var i;
|
||||
for (i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = null;
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
function removeSWF(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj && obj.nodeName == "OBJECT") {
|
||||
if (oEditor.getBrowser().msie) {
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
removeObjectInIE(id);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doSubmit ()
|
||||
{
|
||||
if (newImage == null) {
|
||||
alert("미리 보기 버튼을 클릭하여 이미지를 확인해 주십시오.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
|
||||
document.getElementById(AppID).style.display = 'none';
|
||||
}
|
||||
|
||||
var fm_align = document.getElementById('fm_align').alignment;
|
||||
var align = 'center';
|
||||
var i;
|
||||
|
||||
for (i=0; i<fm_align.length; i++) {
|
||||
if (fm_align[i].checked) {
|
||||
align = fm_align[i].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
newImage.setAttribute("align", align);
|
||||
var p = document.createElement("p");
|
||||
var id = oEditor.makeRandomString();
|
||||
p.id = id;
|
||||
p.setAttribute('align', align);
|
||||
p.appendChild(newImage);
|
||||
oEditor.insertHtmlPopup(p.cloneNode(true));
|
||||
p = oEditor._$(id);
|
||||
var br = document.createElement('br');
|
||||
oEditor.doc.body.insertBefore(br, p);
|
||||
oEditor.doc.body.insertBefore(p, br);
|
||||
|
||||
removeSWF(AppID);
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function outputImageSize (w, h) {
|
||||
var txt = document.createTextNode(w + ' X ' + h);
|
||||
document.getElementById('imageSize').innerHTML = '';
|
||||
document.getElementById('imageSize').appendChild(txt);
|
||||
}
|
||||
|
||||
function showImageSize (w, h) {
|
||||
outputImageSize(w, h);
|
||||
}
|
||||
|
||||
function setWrapper () {
|
||||
var wrapper = document.getElementById('tmpImage');
|
||||
wrapper.style.width = '0px';
|
||||
wrapper.style.height = '0px';
|
||||
wrapper.style.overflow = 'hidden';
|
||||
|
||||
if (navigator.userAgent.toLowerCase().indexOf('opera') != -1) {
|
||||
wrapper.style.visibility = 'hidden';
|
||||
}
|
||||
else {
|
||||
wrapper.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function showPreviewButton() {
|
||||
var img = new Image();
|
||||
img.src = oEditor.config.iconPath + 'button/preview.gif';
|
||||
img.style.verticalAlign = 'middle';
|
||||
img.className = 'button';
|
||||
img.alt = "";
|
||||
img.onclick = doPreview;
|
||||
document.getElementById("inputOutline").appendChild(img);
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
|
||||
CHXUploadRUN(oEditor.config.popupPath + 'flash/ImagePreview');
|
||||
setWrapper();
|
||||
showPreviewButton();
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
125
plugin/editor/cheditor5/popup/js/link.js
Normal file
125
plugin/editor/cheditor5/popup/js/link.js
Normal file
@ -0,0 +1,125 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ================================================================
|
||||
var oEditor = null,
|
||||
button = [
|
||||
{ alt : "", img : 'submit.gif', cmd : returnSelected },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose }
|
||||
];
|
||||
|
||||
function resetValues() {
|
||||
document.getElementById('fm_link_value').value = 'http://';
|
||||
document.getElementById("fm_title").value = '';
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function updateProtocol() {
|
||||
var selectedItem = protocolSel.selectedIndex,
|
||||
selectedItemValue = protocolSel.options[selectedItem].value,
|
||||
inputtedText = document.getElementById("fm_link_value").value,
|
||||
datum,
|
||||
protocol = inputtedText.split(":");
|
||||
|
||||
if (protocol[1]) {
|
||||
datum = protocol[1].replace(/^\/\//, "");
|
||||
datum = datum.replace(/\\/, "");
|
||||
datum = datum.replace(/^\//, "");
|
||||
} else {
|
||||
if (inputtedText.indexOf(":") > 0) {
|
||||
datum = "";
|
||||
} else {
|
||||
datum = protocol[0].replace(/^\/\/\//, "//");
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("fm_link_value").value = selectedItemValue + datum;
|
||||
document.getElementById("fm_link_value").focus();
|
||||
}
|
||||
|
||||
function returnSelected() {
|
||||
var text, target = '', title = '';
|
||||
|
||||
if (document.getElementById("fm_link_value").value !== "") {
|
||||
text = document.getElementById("fm_link_value").value;
|
||||
} else {
|
||||
alert("링크 URL을 입력하여 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (document.getElementById("fm_target").value !== "") {
|
||||
target = document.getElementById("fm_target").value;
|
||||
}
|
||||
|
||||
if (document.getElementById("fm_title").value !== "") {
|
||||
title = document.getElementById("fm_title").value;
|
||||
}
|
||||
|
||||
if ((/^(http|https|file|ftp|mailto|gopher|news|telnet|):\/\//i.test(text)) === false &&
|
||||
(/^(wias|javascript):/i.test(text) === false))
|
||||
{
|
||||
text = "http://" + text;
|
||||
}
|
||||
|
||||
oEditor.hyperLink(text, target, title);
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function getSelected() {
|
||||
var rng = oEditor.range, link = null, protocol, protocolSel, i, oldTarget, targetSel, j;
|
||||
|
||||
if (window.getSelection) {
|
||||
link = oEditor.getElement(rng.startContainer, "A");
|
||||
} else {
|
||||
link = rng.parentElement ? oEditor.getElement(rng.parentElement(), "A") : oEditor.getElement(rng.item(0), "A");
|
||||
}
|
||||
|
||||
if (link === null || link.nodeName.toLowerCase() !== 'a') {
|
||||
return;
|
||||
}
|
||||
|
||||
protocol = link.href.split(":");
|
||||
|
||||
if (protocol[0]) {
|
||||
protocolSel = document.getElementById("fm_protocol");
|
||||
for (i = 0; i < protocolSel.length; i++) {
|
||||
if (protocolSel[i].value.indexOf(protocol[0].toLowerCase()) !== -1) {
|
||||
oldTarget = link.target;
|
||||
targetSel = document.getElementById("fm_target");
|
||||
|
||||
if (oldTarget) {
|
||||
for (j = 0; j < targetSel.length; j++) {
|
||||
if (targetSel[j].value === oldTarget.toLowerCase()) {
|
||||
targetSel[j].selected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
targetSel[0].selected = true;
|
||||
}
|
||||
|
||||
protocolSel[i].selected = true;
|
||||
|
||||
if (link.title) {
|
||||
document.getElementById("fm_title").value = link.title;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
document.getElementById("fm_link_value").value = link.href;
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
resetValues();
|
||||
getSelected();
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
46
plugin/editor/cheditor5/popup/js/media.js
Normal file
46
plugin/editor/cheditor5/popup/js/media.js
Normal file
@ -0,0 +1,46 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
// Homepage: http://www.chcode.com
|
||||
// Copyright (c) 1997-2014 CHSOFT
|
||||
// ================================================================
|
||||
var button = [
|
||||
{ alt : "", img : 'play.gif', cmd : play },
|
||||
{ alt : "", img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose }
|
||||
];
|
||||
|
||||
var oEditor = null;
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
|
||||
function play()
|
||||
{
|
||||
var file = document.getElementById("fm_linkurl");
|
||||
if (!file.value)
|
||||
return;
|
||||
|
||||
var mediaobj = "<embed src='"+file.value+"' autostart='true' loop='true'></embed>";
|
||||
var obj = document.getElementById("play");
|
||||
obj.innerHTML = mediaobj;
|
||||
}
|
||||
|
||||
function doSubmit()
|
||||
{
|
||||
var file = document.getElementById("fm_linkurl");
|
||||
var media = "<embed src='"+file.value+"' autostart='true' loop='true'></embed>";
|
||||
oEditor.insertHtmlPopup(media);
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
779
plugin/editor/cheditor5/popup/js/swfobject.js
Normal file
779
plugin/editor/cheditor5/popup/js/swfobject.js
Normal file
@ -0,0 +1,779 @@
|
||||
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
||||
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
var swfobject = function() {
|
||||
|
||||
var UNDEF = "undefined",
|
||||
OBJECT = "object",
|
||||
SHOCKWAVE_FLASH = "Shockwave Flash",
|
||||
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
||||
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
||||
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
||||
ON_READY_STATE_CHANGE = "onreadystatechange",
|
||||
|
||||
win = window,
|
||||
doc = document,
|
||||
nav = navigator,
|
||||
|
||||
plugin = false,
|
||||
domLoadFnArr = [main],
|
||||
regObjArr = [],
|
||||
objIdArr = [],
|
||||
listenersArr = [],
|
||||
storedAltContent,
|
||||
storedAltContentId,
|
||||
storedCallbackFn,
|
||||
storedCallbackObj,
|
||||
isDomLoaded = false,
|
||||
isExpressInstallActive = false,
|
||||
dynamicStylesheet,
|
||||
dynamicStylesheetMedia,
|
||||
autoHideShow = true,
|
||||
|
||||
/* Centralized function for browser feature detection
|
||||
- User agent string detection is only used when no good alternative is possible
|
||||
- Is executed directly for optimal performance
|
||||
*/
|
||||
ua = function() {
|
||||
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
|
||||
u = nav.userAgent.toLowerCase(),
|
||||
p = nav.platform.toLowerCase(),
|
||||
windows = p ? /win/.test(p) : /win/.test(u),
|
||||
mac = p ? /mac/.test(p) : /mac/.test(u),
|
||||
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
||||
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
||||
playerVersion = [0,0,0],
|
||||
d = null;
|
||||
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
||||
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
||||
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
||||
plugin = true;
|
||||
ie = false; // cascaded feature detection for Internet Explorer
|
||||
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
||||
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
||||
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
||||
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
||||
}
|
||||
}
|
||||
else if (typeof win.ActiveXObject != UNDEF) {
|
||||
try {
|
||||
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
||||
if (a) { // a will return null when ActiveX is disabled
|
||||
d = a.GetVariable("$version");
|
||||
if (d) {
|
||||
ie = true; // cascaded feature detection for Internet Explorer
|
||||
d = d.split(" ")[1].split(",");
|
||||
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
|
||||
}(),
|
||||
|
||||
/* Cross-browser onDomLoad
|
||||
- Will fire an event as soon as the DOM of a web page is loaded
|
||||
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
||||
- Regular onload serves as fallback
|
||||
*/
|
||||
onDomLoad = function() {
|
||||
if (!ua.w3) { return; }
|
||||
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
if (!isDomLoaded) {
|
||||
if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
||||
}
|
||||
if (ua.ie && ua.win) {
|
||||
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
||||
if (doc.readyState == "complete") {
|
||||
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
});
|
||||
if (win == top) { // if not inside an iframe
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
try {
|
||||
doc.documentElement.doScroll("left");
|
||||
}
|
||||
catch(e) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
}
|
||||
if (ua.wk) {
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
if (!/loaded|complete/.test(doc.readyState)) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
addLoadEvent(callDomLoadFunctions);
|
||||
}
|
||||
}();
|
||||
|
||||
function callDomLoadFunctions() {
|
||||
if (isDomLoaded) { return; }
|
||||
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
||||
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
||||
t.parentNode.removeChild(t);
|
||||
}
|
||||
catch (e) { return; }
|
||||
isDomLoaded = true;
|
||||
var dl = domLoadFnArr.length;
|
||||
for (var i = 0; i < dl; i++) {
|
||||
domLoadFnArr[i]();
|
||||
}
|
||||
}
|
||||
|
||||
function addDomLoadEvent(fn) {
|
||||
if (isDomLoaded) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
||||
}
|
||||
}
|
||||
|
||||
/* Cross-browser onload
|
||||
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
||||
- Will fire an event as soon as a web page including all of its assets are loaded
|
||||
*/
|
||||
function addLoadEvent(fn) {
|
||||
if (typeof win.addEventListener != UNDEF) {
|
||||
win.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof win.attachEvent != UNDEF) {
|
||||
addListener(win, "onload", fn);
|
||||
}
|
||||
else if (typeof win.onload == "function") {
|
||||
var fnOld = win.onload;
|
||||
win.onload = function() {
|
||||
fnOld();
|
||||
fn();
|
||||
};
|
||||
}
|
||||
else {
|
||||
win.onload = fn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main function
|
||||
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
||||
*/
|
||||
function main() {
|
||||
if (plugin) {
|
||||
testPlayerVersion();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Detect the Flash Player version for non-Internet Explorer browsers
|
||||
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
||||
a. Both release and build numbers can be detected
|
||||
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
||||
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
||||
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
||||
*/
|
||||
function testPlayerVersion() {
|
||||
var b = doc.getElementsByTagName("body")[0];
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
var t = b.appendChild(o);
|
||||
if (t) {
|
||||
var counter = 0;
|
||||
(function(){
|
||||
if (typeof t.GetVariable != UNDEF) {
|
||||
var d = t.GetVariable("$version");
|
||||
if (d) {
|
||||
d = d.split(" ")[1].split(",");
|
||||
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
else if (counter < 10) {
|
||||
counter++;
|
||||
setTimeout(arguments.callee, 10);
|
||||
return;
|
||||
}
|
||||
b.removeChild(o);
|
||||
t = null;
|
||||
matchVersions();
|
||||
})();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform Flash Player and SWF version matching; static publishing only
|
||||
*/
|
||||
function matchVersions() {
|
||||
var rl = regObjArr.length;
|
||||
if (rl > 0) {
|
||||
for (var i = 0; i < rl; i++) { // for each registered object element
|
||||
var id = regObjArr[i].id;
|
||||
var cb = regObjArr[i].callbackFn;
|
||||
var cbObj = {success:false, id:id};
|
||||
if (ua.pv[0] > 0) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = getObjectById(id);
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
|
||||
var att = {};
|
||||
att.data = regObjArr[i].expressInstall;
|
||||
att.width = obj.getAttribute("width") || "0";
|
||||
att.height = obj.getAttribute("height") || "0";
|
||||
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
|
||||
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
|
||||
// parse HTML object param element's name-value pairs
|
||||
var par = {};
|
||||
var p = obj.getElementsByTagName("param");
|
||||
var pl = p.length;
|
||||
for (var j = 0; j < pl; j++) {
|
||||
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
||||
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
||||
}
|
||||
}
|
||||
showExpressInstall(att, par, id, cb);
|
||||
}
|
||||
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
||||
displayAltContent(obj);
|
||||
if (cb) { cb(cbObj); }
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
var o = getObjectById(id); // test whether there is an HTML object element or not
|
||||
if (o && typeof o.SetVariable != UNDEF) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = o;
|
||||
}
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getObjectById(objectIdStr) {
|
||||
var r = null;
|
||||
var o = getElementById(objectIdStr);
|
||||
if (o && o.nodeName == "OBJECT") {
|
||||
if (typeof o.SetVariable != UNDEF) {
|
||||
r = o;
|
||||
}
|
||||
else {
|
||||
var n = o.getElementsByTagName(OBJECT)[0];
|
||||
if (n) {
|
||||
r = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Requirements for Adobe Express Install
|
||||
- only one instance can be active at a time
|
||||
- fp 6.0.65 or higher
|
||||
- Win/Mac OS only
|
||||
- no Webkit engines older than version 312
|
||||
*/
|
||||
function canExpressInstall() {
|
||||
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
||||
}
|
||||
|
||||
/* Show the Adobe Express Install dialog
|
||||
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
||||
*/
|
||||
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
||||
isExpressInstallActive = true;
|
||||
storedCallbackFn = callbackFn || null;
|
||||
storedCallbackObj = {success:false, id:replaceElemIdStr};
|
||||
var obj = getElementById(replaceElemIdStr);
|
||||
if (obj) {
|
||||
if (obj.nodeName == "OBJECT") { // static publishing
|
||||
storedAltContent = abstractAltContent(obj);
|
||||
storedAltContentId = null;
|
||||
}
|
||||
else { // dynamic publishing
|
||||
storedAltContent = obj;
|
||||
storedAltContentId = replaceElemIdStr;
|
||||
}
|
||||
att.id = EXPRESS_INSTALL_ID;
|
||||
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
|
||||
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
|
||||
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
||||
fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + fv;
|
||||
}
|
||||
else {
|
||||
par.flashvars = fv;
|
||||
}
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
var newObj = createElement("div");
|
||||
replaceElemIdStr += "SWFObjectNew";
|
||||
newObj.setAttribute("id", replaceElemIdStr);
|
||||
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
createSWF(att, par, replaceElemIdStr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to abstract and display alternative content
|
||||
*/
|
||||
function displayAltContent(obj) {
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
var el = createElement("div");
|
||||
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
|
||||
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
||||
}
|
||||
}
|
||||
|
||||
function abstractAltContent(obj) {
|
||||
var ac = createElement("div");
|
||||
if (ua.win && ua.ie) {
|
||||
ac.innerHTML = obj.innerHTML;
|
||||
}
|
||||
else {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
||||
ac.appendChild(c[i].cloneNode(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic SWF creation
|
||||
*/
|
||||
function createSWF(attObj, parObj, id) {
|
||||
var r, el = getElementById(id);
|
||||
if (ua.wk && ua.wk < 312) { return r; }
|
||||
if (el) {
|
||||
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
||||
attObj.id = id;
|
||||
}
|
||||
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
||||
var att = "";
|
||||
for (var i in attObj) {
|
||||
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
|
||||
if (i.toLowerCase() == "data") {
|
||||
parObj.movie = attObj[i];
|
||||
}
|
||||
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
att += ' class="' + attObj[i] + '"';
|
||||
}
|
||||
else if (i.toLowerCase() != "classid") {
|
||||
att += ' ' + i + '="' + attObj[i] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var par = "";
|
||||
for (var j in parObj) {
|
||||
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
|
||||
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
||||
}
|
||||
}
|
||||
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
||||
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
|
||||
r = getElementById(attObj.id);
|
||||
}
|
||||
else { // well-behaving browsers
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var m in attObj) {
|
||||
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
|
||||
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
o.setAttribute("class", attObj[m]);
|
||||
}
|
||||
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
|
||||
o.setAttribute(m, attObj[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var n in parObj) {
|
||||
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
|
||||
createObjParam(o, n, parObj[n]);
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(o, el);
|
||||
r = o;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function createObjParam(el, pName, pValue) {
|
||||
var p = createElement("param");
|
||||
p.setAttribute("name", pName);
|
||||
p.setAttribute("value", pValue);
|
||||
el.appendChild(p);
|
||||
}
|
||||
|
||||
/* Cross-browser SWF removal
|
||||
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
||||
*/
|
||||
function removeSWF(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj && obj.nodeName == "OBJECT") {
|
||||
if (ua.ie && ua.win) {
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
removeObjectInIE(id);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeObjectInIE(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = null;
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to optimize JavaScript compression
|
||||
*/
|
||||
function getElementById(id) {
|
||||
var el = null;
|
||||
try {
|
||||
el = doc.getElementById(id);
|
||||
}
|
||||
catch (e) {}
|
||||
return el;
|
||||
}
|
||||
|
||||
function createElement(el) {
|
||||
return doc.createElement(el);
|
||||
}
|
||||
|
||||
/* Updated attachEvent function for Internet Explorer
|
||||
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
||||
*/
|
||||
function addListener(target, eventType, fn) {
|
||||
target.attachEvent(eventType, fn);
|
||||
listenersArr[listenersArr.length] = [target, eventType, fn];
|
||||
}
|
||||
|
||||
/* Flash Player and SWF content version matching
|
||||
*/
|
||||
function hasPlayerVersion(rv) {
|
||||
var pv = ua.pv, v = rv.split(".");
|
||||
v[0] = parseInt(v[0], 10);
|
||||
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
|
||||
v[2] = parseInt(v[2], 10) || 0;
|
||||
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic CSS creation
|
||||
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
||||
*/
|
||||
function createCSS(sel, decl, media, newStyle) {
|
||||
if (ua.ie && ua.mac) { return; }
|
||||
var h = doc.getElementsByTagName("head")[0];
|
||||
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
|
||||
var m = (media && typeof media == "string") ? media : "screen";
|
||||
if (newStyle) {
|
||||
dynamicStylesheet = null;
|
||||
dynamicStylesheetMedia = null;
|
||||
}
|
||||
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
||||
// create dynamic stylesheet + get a global reference to it
|
||||
var s = createElement("style");
|
||||
s.setAttribute("type", "text/css");
|
||||
s.setAttribute("media", m);
|
||||
dynamicStylesheet = h.appendChild(s);
|
||||
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
||||
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
||||
}
|
||||
dynamicStylesheetMedia = m;
|
||||
}
|
||||
// add style rule
|
||||
if (ua.ie && ua.win) {
|
||||
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
||||
dynamicStylesheet.addRule(sel, decl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
||||
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(id, isVisible) {
|
||||
if (!autoHideShow) { return; }
|
||||
var v = isVisible ? "visible" : "hidden";
|
||||
if (isDomLoaded && getElementById(id)) {
|
||||
getElementById(id).style.visibility = v;
|
||||
}
|
||||
else {
|
||||
createCSS("#" + id, "visibility:" + v);
|
||||
}
|
||||
}
|
||||
|
||||
/* Filter to avoid XSS attacks
|
||||
*/
|
||||
function urlEncodeIfNecessary(s) {
|
||||
var regex = /[\\\"<>\.;]/;
|
||||
var hasBadChars = regex.exec(s) != null;
|
||||
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
||||
}
|
||||
|
||||
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
||||
*/
|
||||
var cleanup = function() {
|
||||
if (ua.ie && ua.win) {
|
||||
window.attachEvent("onunload", function() {
|
||||
// remove listeners to avoid memory leaks
|
||||
var ll = listenersArr.length;
|
||||
for (var i = 0; i < ll; i++) {
|
||||
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
||||
}
|
||||
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
||||
var il = objIdArr.length;
|
||||
for (var j = 0; j < il; j++) {
|
||||
removeSWF(objIdArr[j]);
|
||||
}
|
||||
// cleanup library's main closures to avoid memory leaks
|
||||
for (var k in ua) {
|
||||
ua[k] = null;
|
||||
}
|
||||
ua = null;
|
||||
for (var l in swfobject) {
|
||||
swfobject[l] = null;
|
||||
}
|
||||
swfobject = null;
|
||||
});
|
||||
}
|
||||
}();
|
||||
|
||||
return {
|
||||
/* Public API
|
||||
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
||||
*/
|
||||
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
||||
if (ua.w3 && objectIdStr && swfVersionStr) {
|
||||
var regObj = {};
|
||||
regObj.id = objectIdStr;
|
||||
regObj.swfVersion = swfVersionStr;
|
||||
regObj.expressInstall = xiSwfUrlStr;
|
||||
regObj.callbackFn = callbackFn;
|
||||
regObjArr[regObjArr.length] = regObj;
|
||||
setVisibility(objectIdStr, false);
|
||||
}
|
||||
else if (callbackFn) {
|
||||
callbackFn({success:false, id:objectIdStr});
|
||||
}
|
||||
},
|
||||
|
||||
getObjectById: function(objectIdStr) {
|
||||
if (ua.w3) {
|
||||
return getObjectById(objectIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
||||
var callbackObj = {success:false, id:replaceElemIdStr};
|
||||
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
addDomLoadEvent(function() {
|
||||
widthStr += ""; // auto-convert to string
|
||||
heightStr += "";
|
||||
var att = {};
|
||||
if (attObj && typeof attObj === OBJECT) {
|
||||
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
||||
att[i] = attObj[i];
|
||||
}
|
||||
}
|
||||
att.data = swfUrlStr;
|
||||
att.width = widthStr;
|
||||
att.height = heightStr;
|
||||
var par = {};
|
||||
if (parObj && typeof parObj === OBJECT) {
|
||||
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
||||
par[j] = parObj[j];
|
||||
}
|
||||
}
|
||||
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
||||
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
||||
}
|
||||
else {
|
||||
par.flashvars = k + "=" + flashvarsObj[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPlayerVersion(swfVersionStr)) { // create SWF
|
||||
var obj = createSWF(att, par, replaceElemIdStr);
|
||||
if (att.id == replaceElemIdStr) {
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
callbackObj.success = true;
|
||||
callbackObj.ref = obj;
|
||||
}
|
||||
else if (xiSwfUrlStr) { // show Adobe Express Install
|
||||
if (confirm("Adobe Flash Player "+swfVersionStr+" 이상 버전이 필요합니다.\nCHEditor는 자동으로 Flash Player를 설치하지 않습니다.\n" +
|
||||
"Adobe Flash Player 다운로드 웹사이트를 방문하시겠습니까?")) {
|
||||
window.open(xiSwfUrlStr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else { // show alternative content
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
if (callbackFn) { callbackFn(callbackObj); }
|
||||
});
|
||||
}
|
||||
else if (callbackFn) { callbackFn(callbackObj); }
|
||||
},
|
||||
|
||||
switchOffAutoHideShow: function() {
|
||||
autoHideShow = false;
|
||||
},
|
||||
|
||||
ua: ua,
|
||||
|
||||
getFlashPlayerVersion: function() {
|
||||
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
||||
},
|
||||
|
||||
hasFlashPlayerVersion: hasPlayerVersion,
|
||||
|
||||
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
||||
if (ua.w3) {
|
||||
return createSWF(attObj, parObj, replaceElemIdStr);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
||||
if (ua.w3 && canExpressInstall()) {
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
}
|
||||
},
|
||||
|
||||
removeSWF: function(objElemIdStr) {
|
||||
if (ua.w3) {
|
||||
removeSWF(objElemIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
||||
if (ua.w3) {
|
||||
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
||||
}
|
||||
},
|
||||
|
||||
addDomLoadEvent: addDomLoadEvent,
|
||||
|
||||
addLoadEvent: addLoadEvent,
|
||||
|
||||
getQueryParamValue: function(param) {
|
||||
var q = doc.location.search || doc.location.hash;
|
||||
if (q) {
|
||||
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
|
||||
if (param == null) {
|
||||
return urlEncodeIfNecessary(q);
|
||||
}
|
||||
var pairs = q.split("&");
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// For internal usage only
|
||||
expressInstallCallback: function() {
|
||||
if (isExpressInstallActive) {
|
||||
var obj = getElementById(EXPRESS_INSTALL_ID);
|
||||
if (obj && storedAltContent) {
|
||||
obj.parentNode.replaceChild(storedAltContent, obj);
|
||||
if (storedAltContentId) {
|
||||
setVisibility(storedAltContentId, true);
|
||||
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
|
||||
}
|
||||
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
|
||||
}
|
||||
isExpressInstallActive = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
||||
167
plugin/editor/cheditor5/popup/js/symbol.js
Normal file
167
plugin/editor/cheditor5/popup/js/symbol.js
Normal file
@ -0,0 +1,167 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
// Homepage: http://www.chcode.com
|
||||
// Copyright (c) 1997-2014 CHSOFT
|
||||
// ================================================================
|
||||
var c = null;
|
||||
var curView = null;
|
||||
var S1 = '" ( ) [ ] { } ‘ ’ “ ” 〔 〕 〈 〉 《 》 「 」 『 』 【 】 § ※ ☆ ★ ○ ● ■ △ ▲ ▽ ▼ → 〓 ◁ ◀ ▷ ▶ ♤ ♣ ⊙ ◈ ▣ ◐ ◑ ▧ ▦ ▩ ♨ ☏ ☎ ‡ ㉿ ↕ ↗ ↙ ↖ ↘ ㈜ № ㏇ ™ ㏂ + - < = > ± × ÷ ≠ ≤ ≥ ∞ ∴ ♂ ♀ ∠ ⊥ ⌒ ∂ ∇ ≡ ≒ ≪ ≫ √ ∽ ∝ ∵ ∫ ∬ ∈ ∋ ⊆ ⊇ ⊂ ⊃ ∮ ∪ ∩ ∑ ∏ ∧ ∨ ¬ ⇒ ⇔ ∀ ∃';
|
||||
var S2 = '─ │ ┌ ┐ ┘ └ ├ ┬ ┤ ┴ ┼ ━ ┃ ┏ ┓ ┛ ┗ ┣ ┳ ┫ ┻ ╋ ┠ ┯ ┨ ┷ ┿ ┝ ┰ ┥ ┸ ╂ ┒ ┑ ┚ ┙ ┖ ┕ ┎ ┍ ┞ ┟ ┡ ┢ ┦ ┧ ┩ ┪ ┭ ┮ ┱ ┲ ┵ ┶ ┹ ┺ ┽ ┾ ╀ ╁ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊';
|
||||
var S3 = '½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ¹ ² ³ ⁴ ⁿ ₁ ₂ ₃ ₄ 0 1 2 3 4 5 6 7 8 9 ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ $ % ₩ ° ′ ″ ℃ Å ¢ £ ¥ ¤ ℉ ‰ ㎕ ㎖ ㎗ ℓ ㎘ ㏄ ㎣ ㎤ ㎥ ㎦ ㎙ ㎚ ㎛ ㎜ ㎝ ㎞ ㎟ ㎠ ㎡ ㎢ ㏊ ㎍ ㎎ ㎏ ㏏ ㎈ ㎉ ㏈ ㎧ ㎨ ㎰ ㎱ ㎲ ㎳ ㎴ ㎵ ㎶ ㎷ ㎸ ㎹ ㎀ ㎁ ㎂ ㎃ ㎄ ㎺ ㎻ ㎼ ㎽ ㎾ ㎿ ㎐ ㎑ ㎒ ㎓ ㎔ Ω ㏀ ㏁ ㎊ ㎋ ㎌ ㏖ ㏅ ㎭ ㎮ ㎯ ㏛ ㎩ ㎪ ㎫ ㎬ ㏝ ㏐ ㏓ ㏉ ㏜ ㏆';
|
||||
var S4 = 'ㅥ ㅦ ㅧ ㅨ ㅩ ㅪ ㅫ ㅬ ㅭ ㅮ ㅰ ㅯ ㅱ ㅲ ㅳ ㅴ ㅵ ㅶ ㅷ ㅸ ㅹ ㅺ ㅻ ㅼ ㅽ ㅾ ㅿ ㆀ ㆁ ㆂ ㆃ ㆄ ㆅ ㆆ ㆇ ㆈ ㆉ ㆊ ㆋ ㆌ ㆍ ㆎ';
|
||||
var S5 = '㉠ ㉡ ㉢ ㉣ ㉤ ㉥ ㉦ ㉧ ㉨ ㉩ ㉪ ㉫ ㉬ ㉭ ㉮ ㉯ ㉰ ㉱ ㉲ ㉳ ㉴ ㉶ ㉶ ㉷ ㉸ ㉹ ㉺ ㉻ ㈀ ㈁ ㈂ ㈃ ㈄ ㈅ ㈆ ㈇ ㈈ ㈉ ㈊ ㈋ ㈌ ㈍ ㈎ ㈏ ㈐ ㈑ ㈒ ㈓ ㈔ ㈕ ㈖ ㈗ ㈘ ㈙ ㈚ ㈛ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ ⒨ ⒩ ⒪ ⒫ ⒬ ⒭ ⒮ ⒯ ⒰ ⒱ ⒲ ⒳ ⒴ ⒵ ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂';
|
||||
var japan1 = 'ぁ か さ た ど び ぽ ょ ゑ あ が ざ だ な ぴ ま よ を ぃ き し ち に ふ み ら ん い ぎ じ ぢ ぬ ぶ む り ぅ く す っ ね ぷ め る う ぐ ず つ の へ も れ ぇ け せ づ は べ ゃ ろ え げ ぜ て ば ぺ や ゎ ぉ こ そ で ぱ ほ ゅ わ お ご ぞ と ひ ぼ ゆ ゐ';
|
||||
var japan2 = 'ァ カ サ タ ド ビ ポ ョ ヱ ア ガ ザ ダ ナ ピ マ ヨ ヲ ィ キ シ チ ニ フ ミ ラ ン イ ギ ジ ヂ ヌ ブ ム リ ヴ ゥ ク ス ッ ネ プ メ ル ヵ ウ グ ズ ツ ノ ヘ モ レ ヶ ェ ケ セ ヅ ハ ベ ャ ロ エ ゲ ゼ テ バ ペ ヤ ヮ ォ コ ソ デ パ ホ ュ ワ オ ゴ ゾ ト ヒ ボ ユ ヰ';
|
||||
|
||||
c = S1.split(' ');
|
||||
var button = [ { alt : "", img : 'input.gif', cmd : inputChar },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose } ];
|
||||
|
||||
var oEditor = null;
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
|
||||
setupEvent();
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
|
||||
function hover(obj, val) {
|
||||
obj.style.backgroundColor = val ? "#5579aa" : "#fff";
|
||||
obj.style.color = val ? "#fff" : "#000";
|
||||
}
|
||||
|
||||
function showTable() {
|
||||
var k = 0;
|
||||
var len = c.length;
|
||||
var w = 9;
|
||||
var h = 20;
|
||||
var span, i, j, tr, td;
|
||||
|
||||
var table = document.createElement('table');
|
||||
table.border = 0;
|
||||
table.cellSpacing = 1;
|
||||
table.cellPadding = 0;
|
||||
table.align = 'center';
|
||||
|
||||
var getChar = function() {
|
||||
document.getElementById('fm_input').value = document.getElementById('fm_input').value + c[this.id];
|
||||
};
|
||||
var mouseOver = function() {
|
||||
hover(this, true);
|
||||
};
|
||||
var mouseOut = function() {
|
||||
hover(this, false);
|
||||
};
|
||||
for (i=0; i < w; i++) {
|
||||
tr = table.insertRow(i);
|
||||
for (j = 0; j < h; j++) {
|
||||
td = tr.insertCell(j);
|
||||
td.className = 'schar';
|
||||
|
||||
if ( len < k+1) {
|
||||
td.appendChild(document.createTextNode('\u00a0'));
|
||||
}
|
||||
else {
|
||||
td.style.cursor = 'pointer';
|
||||
td.id = k;
|
||||
td.onclick = getChar;
|
||||
td.onmouseover = mouseOver;
|
||||
td.onmouseout = mouseOut;
|
||||
span = document.createElement("span");
|
||||
span.style.fontSize = "13px";
|
||||
span.appendChild(document.createTextNode(c[k]));
|
||||
td.appendChild(span);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
var output = document.getElementById('output');
|
||||
if (output.hasChildNodes()) {
|
||||
for (i=0; i<output.childNodes.length; i++) {
|
||||
output.removeChild(output.firstChild);
|
||||
}
|
||||
}
|
||||
output.appendChild(table);
|
||||
}
|
||||
|
||||
function sp1 () {
|
||||
c = S1.split(' ');
|
||||
showTable();
|
||||
}
|
||||
|
||||
function sp2 () {
|
||||
c = S2.split(' ');
|
||||
showTable();
|
||||
}
|
||||
|
||||
function sp3 () {
|
||||
c = S3.split(' ');
|
||||
showTable();
|
||||
}
|
||||
|
||||
function sp4 () {
|
||||
c = S4.split(' ');
|
||||
showTable();
|
||||
}
|
||||
|
||||
function sp5 () {
|
||||
c = S5.split(' ');
|
||||
showTable();
|
||||
}
|
||||
|
||||
function sp6 () {
|
||||
c = japan1.split(' ').concat(japan2.split(' '));
|
||||
showTable();
|
||||
}
|
||||
|
||||
function inputChar() {
|
||||
oEditor.insertHtmlPopup(document.getElementById('fm_input').value);
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function setupEvent() {
|
||||
var el = document.body.getElementsByTagName('LABEL');
|
||||
var i;
|
||||
var tab = function() {
|
||||
document.getElementById(this.id).style.fontWeight = 'bold';
|
||||
switch (this.id) {
|
||||
case 's1' : sp1(); break;
|
||||
case 's2' : sp2(); break;
|
||||
case 's3' : sp3(); break;
|
||||
case 's4' : sp4(); break;
|
||||
case 's5' : sp5(); break;
|
||||
default : sp6();
|
||||
}
|
||||
|
||||
if (curView != this.id) {
|
||||
document.getElementById(curView).style.fontWeight = 'normal';
|
||||
}
|
||||
curView = this.id;
|
||||
};
|
||||
|
||||
for (i=0; i < el.length; i++) {
|
||||
el[i].className = 'handCursor';
|
||||
el[i].style.fontSize = '9pt';
|
||||
el[i].style.margin = (i==0) ? '0px 0px 5px 5px' : '0px 0px 5px 0px';
|
||||
el[i].onclick = tab;
|
||||
}
|
||||
|
||||
if (curView == null) {
|
||||
showTable();
|
||||
curView = 's1';
|
||||
document.getElementById(curView).style.fontWeight = 'bold';
|
||||
document.getElementById('output').style.visibility = 'visible';
|
||||
}
|
||||
document.getElementById("fm_input").value = "";
|
||||
}
|
||||
315
plugin/editor/cheditor5/popup/js/table.js
Normal file
315
plugin/editor/cheditor5/popup/js/table.js
Normal file
@ -0,0 +1,315 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
// Homepage: http://www.chcode.com
|
||||
// Copyright (c) 1997-2014 CHSOFT
|
||||
// ================================================================
|
||||
var oEditor = null;
|
||||
var colour = ["ffffcc","ffcc66","ff9900","ffcc99","ff6633","ffcccc","cc9999","ff6699","ff99cc","ff66cc","ffccff","cc99cc","cc66ff","cc99ff","9966cc","ccccff","9999cc","3333ff","6699ff","0066ff","99ccff","66ccff","99cccc","ccffff","99ffcc","66cc99","66ff99","99ff99","ccffcc","33ff33","66ff00","ccff99","99ff00","ccff66","cccc66","ffffff",
|
||||
"ffff99","ffcc00","ff9933","ff9966","cc3300","ff9999","cc6666","ff3366","ff3399","ff00cc","ff99ff","cc66cc","cc33ff","9933cc","9966ff","9999ff","6666ff","3300ff","3366ff","0066cc","3399ff","33ccff","66cccc","99ffff","66ffcc","33cc99","33ff99","66ff66","99cc99","00ff33","66ff33","99ff66","99ff33","ccff00","cccc33","cccccc",
|
||||
"ffff66","ffcc33","cc9966","ff6600","ff3300","ff6666","cc3333","ff0066","ff0099","ff33cc","ff66ff","cc00cc","cc00ff","9933ff","6600cc","6633ff","6666cc","3300cc","0000ff","3366cc","0099ff","00ccff","339999","66ffff","33ffcc","00cc99","00ff99","33ff66","66cc66","00ff00","33ff00","66cc00","99cc66","ccff33","999966","999999",
|
||||
"ffff33","cc9900","cc6600","cc6633","ff0000","ff3333","993333","cc3366","cc0066","cc6699","ff33ff","cc33cc","9900cc","9900ff","6633cc","6600ff","666699","3333cc","0000cc","0033ff","6699cc","3399cc","669999","33ffff","00ffcc","339966","33cc66","00ff66","669966","00cc00","33cc00","66cc33","99cc00","cccc99","999933","666666",
|
||||
"ffff00","cc9933","996633","993300","cc0000","ff0033","990033","996666","993366","cc0099","ff00ff","990099","996699","660099","663399","330099","333399","000099","0033cc","003399","336699","0099cc","006666","00ffff","33cccc","009966","00cc66","339933","336633","33cc33","339900","669933","99cc33","666633","999900","333333",
|
||||
"cccc00","996600","663300","660000","990000","cc0033","330000","663333","660033","990066","cc3399","993399","660066","663366","330033","330066","333366","000066","000033","003366","006699","003333","336666","00cccc","009999","006633","009933","006600","003300","00cc33","009900","336600","669900","333300","666600","000000"];
|
||||
|
||||
var none = '없음';
|
||||
var whichColor = null;
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
|
||||
function getColor()
|
||||
{
|
||||
var color = this.bgColor;
|
||||
var input = document.getElementById("id"+whichColor);
|
||||
input.style.backgroundColor = input.value = color;
|
||||
}
|
||||
|
||||
function drawColor() {
|
||||
var table, tr, td, insideTable, k = 0, i, j, tr2, td2;
|
||||
|
||||
table = document.createElement('table');
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
table.align = 'center';
|
||||
tr = table.insertRow(0);
|
||||
td = tr.insertCell(0);
|
||||
td.style.backgroundColor = '#fff';
|
||||
|
||||
insideTable = document.createElement('table');
|
||||
insideTable.border = 0;
|
||||
insideTable.cellSpacing = 1;
|
||||
insideTable.cellPadding = 0;
|
||||
insideTable.align = 'center';
|
||||
|
||||
var onMouseOver = function() { this.className = 'colorCellMouseOver'; };
|
||||
var onMouseOut = function() { this.className = 'colorCellMouseOut'; };
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
tr2 = insideTable.insertRow(i);
|
||||
for (j = 0; j < 36; j++) {
|
||||
td2 = tr2.insertCell(j);
|
||||
td2.setAttribute('bgColor', '#' + colour[k]);
|
||||
td2.className = 'colorCellMouseOut';
|
||||
td2.onclick = getColor;
|
||||
td2.appendChild(document.createTextNode('\u00a0'));
|
||||
td2.onmouseover = onMouseOver;
|
||||
td2.onmouseout = onMouseOut;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
td.appendChild(insideTable);
|
||||
document.getElementById('colorWrapper').appendChild(table);
|
||||
}
|
||||
|
||||
function setColor(which) {
|
||||
whichColor = which;
|
||||
}
|
||||
|
||||
function doSubmit()
|
||||
{
|
||||
var rows, cols, border, width, widthType, height, cellpd, cellsp, bgcolor, align, bordercolor, cssclass, cssid, cellWidth;
|
||||
rows = document.getElementById("numrows").value;
|
||||
rows = parseInt(oEditor.trimSpace(rows), 10);
|
||||
if (isNaN(rows)) {
|
||||
rows = 0;
|
||||
}
|
||||
|
||||
cols = document.getElementById("numcols").value;
|
||||
cols = parseInt(oEditor.trimSpace(cols), 10);
|
||||
if (isNaN(cols)) {
|
||||
cols = 0;
|
||||
}
|
||||
|
||||
border = document.getElementById("bordersize").value;
|
||||
border = parseInt(oEditor.trimSpace(border), 10);
|
||||
if (isNaN(border)) {
|
||||
border = 0;
|
||||
}
|
||||
|
||||
width = document.getElementById("width").value;
|
||||
width = parseInt(oEditor.trimSpace(width), 10);
|
||||
widthType = document.getElementById("widthtype").value;
|
||||
if (isNaN(width)) {
|
||||
cellWidth = width = null;
|
||||
}
|
||||
else {
|
||||
cellWidth = parseInt(width / cols, 10) + widthType;
|
||||
width += widthType;
|
||||
}
|
||||
|
||||
height = document.getElementById("height").value;
|
||||
height = parseInt(oEditor.trimSpace(height), 10);
|
||||
if (isNaN(height)) {
|
||||
height = null;
|
||||
}
|
||||
else {
|
||||
height += document.getElementById("heighttype").value;
|
||||
}
|
||||
|
||||
cellpd = document.getElementById("cellpd").value;
|
||||
cellpd = parseInt(oEditor.trimSpace(cellpd), 10);
|
||||
if (isNaN(cellpd)) {
|
||||
cellpd = 0;
|
||||
}
|
||||
|
||||
cellsp = document.getElementById("cellsp").value;
|
||||
cellsp = parseInt(oEditor.trimSpace(cellsp), 10);
|
||||
if (isNaN(cellsp)) {
|
||||
cellsp = 0;
|
||||
}
|
||||
|
||||
bgcolor = document.getElementById("idbgcolor").value;
|
||||
bgcolor = oEditor.trimSpace(bgcolor);
|
||||
if (bgcolor === none || bgcolor === '') {
|
||||
bgcolor = null;
|
||||
}
|
||||
|
||||
align = document.getElementById("talign").value;
|
||||
if (align === 'none') {
|
||||
align = null;
|
||||
}
|
||||
|
||||
bordercolor = document.getElementById("idbordercolor").value;
|
||||
bordercolor = oEditor.trimSpace(bordercolor);
|
||||
if (bordercolor === '') {
|
||||
bordercolor = null;
|
||||
}
|
||||
|
||||
cssclass = document.getElementById("cssClass").value;
|
||||
cssclass = oEditor.trimSpace(cssclass);
|
||||
if (cssclass === '') {
|
||||
cssclass = null;
|
||||
}
|
||||
|
||||
cssid = document.getElementById("cssId").value;
|
||||
cssid = oEditor.trimSpace(cssid);
|
||||
if (cssid === '') {
|
||||
cssid = null;
|
||||
}
|
||||
|
||||
if (rows < 1 || cols < 1) {
|
||||
alert('표의 줄 또는 칸 개수가 1개 이상 필요합니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
var caption = document.getElementById('tableCaption');
|
||||
var captionValue = oEditor.trimSpace(caption.value);
|
||||
var summary = document.getElementById('tableSummary');
|
||||
var summaryValue = oEditor.trimSpace(summary.value);
|
||||
var header = document.getElementById('tableHeader').value;
|
||||
var table = document.createElement("table");
|
||||
|
||||
var createHeadCell = function(scope) {
|
||||
var cell = document.createElement('th');
|
||||
cell.setAttribute('scope', scope);
|
||||
return cell;
|
||||
};
|
||||
|
||||
var oHead = document.createElement('thead');
|
||||
var oBody = document.createElement('tbody');
|
||||
|
||||
if (border) {
|
||||
if (bordercolor) {
|
||||
table.style.borderColor = oEditor.colorConvert(bordercolor, 'rgb');
|
||||
}
|
||||
table.style.borderStyle = 'solid';
|
||||
table.style.borderWidth = border + 'px';
|
||||
}
|
||||
|
||||
table.style.borderCollapse = "collapse";
|
||||
|
||||
var i, row, tr, j, cell;
|
||||
for (i=0; i < rows; i++) {
|
||||
tr = document.createElement('tr');
|
||||
if ((header === 'col' || header === 'all') && i===0) {
|
||||
row = oHead.appendChild(tr);
|
||||
}
|
||||
else {
|
||||
row = oBody.appendChild(tr);
|
||||
}
|
||||
|
||||
for (j=0; j < cols; j++) {
|
||||
if (header === 'col' && i===0) {
|
||||
cell = createHeadCell('col');
|
||||
}
|
||||
else if (header === 'all') {
|
||||
if (j === 0) {
|
||||
cell = createHeadCell('row');
|
||||
}
|
||||
else if (i === 0 && j > 0) {
|
||||
cell = createHeadCell('col');
|
||||
}
|
||||
else {
|
||||
cell = document.createElement('td');
|
||||
}
|
||||
}
|
||||
else if (header === 'row' && j === 0) {
|
||||
cell = createHeadCell('row');
|
||||
}
|
||||
else {
|
||||
cell = document.createElement('td');
|
||||
}
|
||||
|
||||
if (border) {
|
||||
cell.style.borderStyle = 'solid';
|
||||
cell.style.borderWidth = table.style.borderWidth;
|
||||
cell.style.borderColor = table.style.borderColor;
|
||||
}
|
||||
// cell.setAttribute("width", cellWidth);
|
||||
cell.appendChild(document.createTextNode('\u00a0'));
|
||||
row.appendChild(cell);
|
||||
}
|
||||
}
|
||||
|
||||
if (oHead.hasChildNodes()) {
|
||||
table.appendChild(oHead);
|
||||
}
|
||||
|
||||
table.appendChild(oBody);
|
||||
|
||||
if (summaryValue !== '') {
|
||||
table.setAttribute('summary', summaryValue);
|
||||
}
|
||||
if (width) {
|
||||
table.style.width = width;
|
||||
}
|
||||
if (height) {
|
||||
table.style.height = height;
|
||||
}
|
||||
if (align) {
|
||||
table.setAttribute("align", align);
|
||||
}
|
||||
if (bgcolor) {
|
||||
table.setAttribute("bgcolor", bgcolor);
|
||||
}
|
||||
|
||||
table.setAttribute("cellpadding", cellpd);
|
||||
table.setAttribute("cellspacing", cellsp);
|
||||
|
||||
if (captionValue !== '') {
|
||||
var hideCaption, tableCaption;
|
||||
tableCaption = table.createCaption();
|
||||
tableCaption.appendChild(document.createTextNode(captionValue));
|
||||
|
||||
hideCaption = document.getElementById('hideCaption');
|
||||
if (hideCaption.checked === true) {
|
||||
tableCaption.style.visibility = 'hidden';
|
||||
tableCaption.style.overFlow = 'hidden';
|
||||
tableCaption.style.lineHeight = '0px';
|
||||
tableCaption.style.position = 'absolute';
|
||||
tableCaption.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
table.id = oEditor.makeRandomString();
|
||||
oEditor.insertHtmlPopup(table.cloneNode(true));
|
||||
var newTable = oEditor.$(table.id);
|
||||
newTable.removeAttribute('id');
|
||||
|
||||
if (cssclass) {
|
||||
newTable.className = cssclass;
|
||||
}
|
||||
if (cssid) {
|
||||
newTable.id = cssid;
|
||||
}
|
||||
|
||||
var focusCell = newTable.getElementsByTagName('th')[0];
|
||||
if (oEditor.undefined(focusCell)) {
|
||||
focusCell = newTable.getElementsByTagName('td')[0];
|
||||
}
|
||||
|
||||
if (oEditor.getBrowser().msie) {
|
||||
var cursor = oEditor.doc.body.createTextRange();
|
||||
cursor.moveToElementText(focusCell);
|
||||
cursor.collapse(false);
|
||||
cursor.select();
|
||||
oEditor.backupRange(oEditor.getRange());
|
||||
}
|
||||
else {
|
||||
var selection = oEditor.getSelection();
|
||||
var range = oEditor.getRange();
|
||||
range.selectNodeContents(focusCell);
|
||||
range.collapse(false);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var button = [ { alt : "", img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose } ];
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
}
|
||||
640
plugin/editor/cheditor5/popup/js/table_modify.js
Normal file
640
plugin/editor/cheditor5/popup/js/table_modify.js
Normal file
@ -0,0 +1,640 @@
|
||||
// ================================================================
|
||||
// CHEditor 5
|
||||
// ----------------------------------------------------------------
|
||||
// Homepage: http://www.chcode.com
|
||||
// Copyright (c) 1997-2014 CHSOFT
|
||||
// ================================================================
|
||||
var oEditor = null;
|
||||
var button = [ { alt : "", img : 'submit.gif', cmd : doSubmit },
|
||||
{ alt : "", img : 'cancel.gif', cmd : popupClose } ];
|
||||
|
||||
var colour = ["ffffcc","ffcc66","ff9900","ffcc99","ff6633","ffcccc","cc9999","ff6699","ff99cc","ff66cc","ffccff","cc99cc","cc66ff","cc99ff","9966cc","ccccff","9999cc","3333ff","6699ff","0066ff","99ccff","66ccff","99cccc","ccffff","99ffcc","66cc99","66ff99","99ff99","ccffcc","33ff33","66ff00","ccff99","99ff00","ccff66","cccc66","ffffff",
|
||||
"ffff99","ffcc00","ff9933","ff9966","cc3300","ff9999","cc6666","ff3366","ff3399","ff00cc","ff99ff","cc66cc","cc33ff","9933cc","9966ff","9999ff","6666ff","3300ff","3366ff","0066cc","3399ff","33ccff","66cccc","99ffff","66ffcc","33cc99","33ff99","66ff66","99cc99","00ff33","66ff33","99ff66","99ff33","ccff00","cccc33","cccccc",
|
||||
"ffff66","ffcc33","cc9966","ff6600","ff3300","ff6666","cc3333","ff0066","ff0099","ff33cc","ff66ff","cc00cc","cc00ff","9933ff","6600cc","6633ff","6666cc","3300cc","0000ff","3366cc","0099ff","00ccff","339999","66ffff","33ffcc","00cc99","00ff99","33ff66","66cc66","00ff00","33ff00","66cc00","99cc66","ccff33","999966","999999",
|
||||
"ffff33","cc9900","cc6600","cc6633","ff0000","ff3333","993333","cc3366","cc0066","cc6699","ff33ff","cc33cc","9900cc","9900ff","6633cc","6600ff","666699","3333cc","0000cc","0033ff","6699cc","3399cc","669999","33ffff","00ffcc","339966","33cc66","00ff66","669966","00cc00","33cc00","66cc33","99cc00","cccc99","999933","666666",
|
||||
"ffff00","cc9933","996633","993300","cc0000","ff0033","990033","996666","993366","cc0099","ff00ff","990099","996699","660099","663399","330099","333399","000099","0033cc","003399","336699","0099cc","006666","00ffff","33cccc","009966","00cc66","339933","336633","33cc33","339900","669933","99cc33","666633","999900","333333",
|
||||
"cccc00","996600","663300","660000","990000","cc0033","330000","663333","660033","990066","cc3399","993399","660066","663366","330033","330066","333366","000066","000033","003366","006699","003333","336666","00cccc","009999","006633","009933","006600","003300","00cc33","009900","336600","669900","333300","666600","000000"];
|
||||
|
||||
var none = '없음';
|
||||
var modifyTable;
|
||||
var beforeHeaderType;
|
||||
var whichColor = null;
|
||||
|
||||
function popupClose() {
|
||||
oEditor.popupWinCancel();
|
||||
}
|
||||
|
||||
function isError() {
|
||||
alert('표 정보를 얻을 수 없습니다. 수정하실 표을 다시 한 번 선택해 주십시오.');
|
||||
popupClose();
|
||||
}
|
||||
|
||||
function init(dialog) {
|
||||
oEditor = this;
|
||||
oEditor.dialog = dialog;
|
||||
|
||||
var dlg = new Dialog(oEditor);
|
||||
dlg.showButton(button);
|
||||
dlg.setDialogHeight();
|
||||
|
||||
var rng = oEditor.range, pNode;
|
||||
|
||||
if (oEditor.W3CRange) {
|
||||
pNode = rng.commonAncestorContainer;
|
||||
if (!rng.collapsed &&
|
||||
rng.startContainer === rng.endContainer &&
|
||||
rng.startOffset - rng.endOffset < 2 &&
|
||||
rng.startContainer.hasChildNodes())
|
||||
{
|
||||
pNode = rng.startContainer.childNodes[rng.startOffset];
|
||||
}
|
||||
|
||||
while (pNode.nodeType === 3) {
|
||||
pNode = pNode.parentNode;
|
||||
}
|
||||
|
||||
if (pNode.nodeName !== 'TD' && pNode.nodeName !== 'TH' && pNode.nodeName !== 'CAPTION' && pNode.nodeName !== 'TABLE')
|
||||
{
|
||||
isError();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (rng.item) {
|
||||
pNode = rng.item(0);
|
||||
if (pNode.nodeName.toLowerCase() !== 'table') {
|
||||
isError();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pNode = rng.parentElement();
|
||||
}
|
||||
}
|
||||
|
||||
while (pNode && pNode.nodeName.toLowerCase() !== 'table') {
|
||||
pNode = pNode.parentNode;
|
||||
}
|
||||
|
||||
if (pNode.nodeName.toLowerCase() !== 'table') {
|
||||
isError();
|
||||
return;
|
||||
}
|
||||
|
||||
modifyTable = pNode;
|
||||
var border, el_size, fm_size, el_type, fm_type, cellpd, cellsp, bgcolor, idbgcolor,
|
||||
bordercolor, idbordercolor, captionValue, summaryValue, caption, captionInput, summary;
|
||||
|
||||
border = modifyTable.getAttribute('border');
|
||||
if (!border || isNaN(border)) {
|
||||
border = parseInt(modifyTable.style.borderWidth, 10);
|
||||
if (!border) {
|
||||
border = 0;
|
||||
}
|
||||
}
|
||||
document.getElementById("bordersize").value = border;
|
||||
|
||||
if (modifyTable.className !== '') {
|
||||
document.getElementById('cssClass').value = modifyTable.className;
|
||||
}
|
||||
if (modifyTable.id !== '') {
|
||||
document.getElementById('cssId').value = modifyTable.id;
|
||||
}
|
||||
|
||||
el_size = modifyTable.getAttribute('width');
|
||||
if (!el_size) {
|
||||
el_size = modifyTable.style.width;
|
||||
}
|
||||
|
||||
fm_size = document.getElementById("width");
|
||||
el_type = 'px';
|
||||
fm_type = document.getElementById("widthtype");
|
||||
|
||||
if (el_size) {
|
||||
el_type = (/%$/.test(el_size)) ? '%' : 'px';
|
||||
el_size = parseInt(el_size, 10);
|
||||
if (isNaN(el_size)) {
|
||||
el_size = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
el_size = '';
|
||||
}
|
||||
|
||||
fm_size.value = el_size;
|
||||
fm_type.value = el_type;
|
||||
|
||||
el_size = modifyTable.getAttribute('height');
|
||||
if (!el_size) {
|
||||
el_size = modifyTable.style.height;
|
||||
}
|
||||
fm_size = document.getElementById("height");
|
||||
el_type = 'px';
|
||||
fm_type = document.getElementById("heighttype");
|
||||
|
||||
if (el_size) {
|
||||
el_type = (/\%$/.test(el_size)) ? '%' : 'px';
|
||||
el_size = parseInt(el_size, 10);
|
||||
if (isNaN(el_size)) {
|
||||
el_size = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
el_size = '';
|
||||
}
|
||||
|
||||
fm_size.value = el_size;
|
||||
fm_type.value = el_type;
|
||||
|
||||
fm_type = modifyTable.getAttribute('align');
|
||||
if (!fm_type) {
|
||||
fm_type = 'none';
|
||||
}
|
||||
document.getElementById("talign").value = fm_type;
|
||||
|
||||
cellpd = modifyTable.getAttribute('cellpadding');
|
||||
if (isNaN(cellpd)) {
|
||||
cellpd = 0;
|
||||
}
|
||||
document.getElementById("cellpd").value = cellpd || 0;
|
||||
|
||||
cellsp = modifyTable.getAttribute('cellspacing');
|
||||
if (isNaN(cellsp)) {
|
||||
cellsp = 0;
|
||||
}
|
||||
document.getElementById("cellsp").value = cellsp || 0;
|
||||
|
||||
bgcolor = modifyTable.getAttribute('bgcolor');
|
||||
idbgcolor = document.getElementById("idbgcolor");
|
||||
if (bgcolor) {
|
||||
if (/rgb/.test(bgcolor)) {
|
||||
bgcolor = oEditor.colorConvert(bgcolor, 'hex');
|
||||
}
|
||||
idbgcolor.value = bgcolor.toLowerCase();
|
||||
idbgcolor.style.backgroundColor = idbgcolor.value;
|
||||
}
|
||||
else {
|
||||
idbgcolor.value = none;
|
||||
}
|
||||
|
||||
bordercolor = modifyTable.getAttribute('bordercolor');
|
||||
if (!bordercolor) {
|
||||
bordercolor = modifyTable.style.borderColor;
|
||||
if (bordercolor) {
|
||||
bordercolor = oEditor.colorConvert(bordercolor, 'hex');
|
||||
}
|
||||
else {
|
||||
bordercolor = null;
|
||||
}
|
||||
}
|
||||
|
||||
idbordercolor = document.getElementById("idbordercolor");
|
||||
if (bordercolor) {
|
||||
if (/rgb/.test(bordercolor)) {
|
||||
bordercolor = oEditor.colorConvert(bordercolor, 'hex');
|
||||
}
|
||||
idbordercolor.value = bordercolor.toLowerCase();
|
||||
idbordercolor.style.backgroundColor = idbordercolor.value;
|
||||
}
|
||||
else {
|
||||
idbordercolor.value = none;
|
||||
}
|
||||
|
||||
caption = modifyTable.getElementsByTagName('caption')[0];
|
||||
if (caption) {
|
||||
captionValue = oEditor.trimSpace(caption.innerHTML);
|
||||
if (captionValue !== '') {
|
||||
captionInput = document.getElementById('tableCaption');
|
||||
captionInput.value = captionValue;
|
||||
|
||||
if (caption.style.visibility === 'hidden') {
|
||||
document.getElementById('hideCaption').checked = 'checked';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
summaryValue = modifyTable.getAttribute('summary');
|
||||
if (summaryValue) {
|
||||
summaryValue = oEditor.trimSpace(summaryValue);
|
||||
if (summaryValue !== '') {
|
||||
summary = document.getElementById('tableSummary');
|
||||
summary.value = summaryValue;
|
||||
}
|
||||
}
|
||||
|
||||
var tableHeader, rows, i, j, cells, headCol, headRow, rowLength, rowCellLength, cellLength, header, headTagName;
|
||||
headCol = headRow = null;
|
||||
headTagName = 'th';
|
||||
|
||||
tableHeader = document.getElementById('tableHeader');
|
||||
rows = (modifyTable.rows && modifyTable.rows.length > 0) ? modifyTable.rows : modifyTable.getElementsByTagName('tr');
|
||||
rowLength = rows.length;
|
||||
|
||||
document.getElementById('numrows').appendChild(document.createTextNode(rowLength));
|
||||
|
||||
if (rowLength > 0) {
|
||||
cells = rows[0].cells;
|
||||
cellLength = cells.length;
|
||||
if (cellLength > 0) {
|
||||
for (j=0; j < cellLength; j++) {
|
||||
if (cells[j].tagName.toLowerCase() === headTagName) {
|
||||
headCol = 'col';
|
||||
}
|
||||
else {
|
||||
headCol = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rowCellLength = 0;
|
||||
for (i=0; i < rowLength; i++) {
|
||||
headRow = (rows[i].cells[0] && rows[i].cells[0].tagName.toLowerCase() === headTagName) ? 'row' : null;
|
||||
if (rowCellLength < rows[i].cells.length) {
|
||||
rowCellLength = rows[i].cells.length;
|
||||
}
|
||||
}
|
||||
|
||||
if (headRow && headCol && cellLength === 1) {
|
||||
headCol = null;
|
||||
}
|
||||
document.getElementById('numcols').appendChild(document.createTextNode(rowCellLength));
|
||||
}
|
||||
|
||||
header = (headCol && headRow) ? 'all' : headCol || headRow || 'none';
|
||||
tableHeader.value = beforeHeaderType = header;
|
||||
}
|
||||
|
||||
function getColor()
|
||||
{
|
||||
var color = this.bgColor;
|
||||
var input = document.getElementById("id"+whichColor);
|
||||
input.style.backgroundColor = input.value = color;
|
||||
}
|
||||
|
||||
function drawColor() {
|
||||
var table, tr, td, insideTable, k = 0, i, j, tr2, td2;
|
||||
|
||||
table = document.createElement('table');
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
table.align = 'center';
|
||||
tr = table.insertRow(0);
|
||||
td = tr.insertCell(0);
|
||||
td.style.backgroundColor = '#fff';
|
||||
|
||||
insideTable = document.createElement('table');
|
||||
insideTable.border = 0;
|
||||
insideTable.cellSpacing = 1;
|
||||
insideTable.cellPadding = 0;
|
||||
insideTable.align = 'center';
|
||||
|
||||
var onMouseOver = function() { this.className = 'colorCellMouseOver'; };
|
||||
var onMouseOut = function() { this.className = 'colorCellMouseOut'; };
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
tr2 = insideTable.insertRow(i);
|
||||
for (j = 0; j < 36; j++) {
|
||||
td2 = tr2.insertCell(j);
|
||||
td2.setAttribute('bgColor', '#' + colour[k]);
|
||||
td2.className = 'colorCellMouseOut';
|
||||
td2.onclick = getColor;
|
||||
td2.appendChild(document.createTextNode('\u00a0'));
|
||||
td2.onmouseover = onMouseOver;
|
||||
td2.onmouseout = onMouseOut;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
td.appendChild(insideTable);
|
||||
document.getElementById('colorWrapper').appendChild(table);
|
||||
}
|
||||
|
||||
function setColor(which) {
|
||||
whichColor = which;
|
||||
}
|
||||
|
||||
function doSubmit()
|
||||
{
|
||||
var width, widthType, widthValue, cellWidth, i, j, row, rows, cell;
|
||||
width = document.getElementById("width");
|
||||
widthType = document.getElementById("widthtype").value;
|
||||
if (width) {
|
||||
widthValue = parseInt(oEditor.trimSpace(width.value), 10);
|
||||
if (isNaN(widthValue)) {
|
||||
cellWidth = widthValue = null;
|
||||
}
|
||||
else {
|
||||
modifyTable.removeAttribute('width');
|
||||
modifyTable.style.width = widthValue + widthType;
|
||||
rows = modifyTable.rows;
|
||||
if (rows.length > 0) {
|
||||
for (i=0; i < rows.length; i++) {
|
||||
row = rows[i];
|
||||
for (j=0; j < row.cells.length; j++) {
|
||||
cellWidth = parseInt(widthValue/row.cells.length, 10) + widthType;
|
||||
cell = row.cells[j];
|
||||
cell.setAttribute("width", cellWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var height, heightValue;
|
||||
height = document.getElementById("height");
|
||||
if (height) {
|
||||
heightValue = parseInt(oEditor.trimSpace(height.value), 10);
|
||||
if (isNaN(heightValue)) {
|
||||
heightValue = null;
|
||||
}
|
||||
else {
|
||||
heightValue += document.getElementById("heighttype").value;
|
||||
modifyTable.removeAttribute('height');
|
||||
modifyTable.style.height = heightValue;
|
||||
}
|
||||
}
|
||||
|
||||
var cellpadding, cellpaddingValue;
|
||||
cellpadding = document.getElementById("cellpd");
|
||||
if (cellpadding) {
|
||||
cellpaddingValue = oEditor.trimSpace(cellpadding.value);
|
||||
if (!cellpaddingValue || isNaN(cellpaddingValue)) {
|
||||
cellpaddingValue = 0;
|
||||
}
|
||||
else {
|
||||
cellpaddingValue = parseInt(cellpaddingValue, 10);
|
||||
}
|
||||
modifyTable.setAttribute('cellpadding', cellpaddingValue);
|
||||
}
|
||||
|
||||
var cellspacing, cellspacingValue;
|
||||
cellspacing = document.getElementById("cellsp");
|
||||
if (cellspacing) {
|
||||
cellspacingValue = oEditor.trimSpace(cellspacing.value);
|
||||
if (!cellspacingValue || isNaN(cellspacingValue)) {
|
||||
cellspacingValue = 0;
|
||||
}
|
||||
else {
|
||||
cellspacingValue = parseInt(cellspacingValue, 10);
|
||||
}
|
||||
modifyTable.setAttribute('cellspacing', cellspacingValue);
|
||||
}
|
||||
|
||||
var bgcolor, bgcolorValue;
|
||||
bgcolor = document.getElementById("idbgcolor");
|
||||
if (bgcolor) {
|
||||
bgcolorValue = oEditor.trimSpace(bgcolor.value);
|
||||
if (bgcolorValue !== '' && bgcolorValue !== none) {
|
||||
modifyTable.removeAttribute('bgcolor');
|
||||
modifyTable.bgColor = bgcolorValue;
|
||||
}
|
||||
}
|
||||
|
||||
var align, alignValue;
|
||||
align = document.getElementById("talign");
|
||||
if (align) {
|
||||
alignValue = align.value;
|
||||
if (alignValue !== 'none') {
|
||||
modifyTable.removeAttribute('align');
|
||||
modifyTable.setAttribute('align', alignValue);
|
||||
}
|
||||
}
|
||||
|
||||
var cssclass, cssclassValue, cssid, cssidValue;
|
||||
cssclass = document.getElementById('cssClass');
|
||||
cssclassValue = oEditor.trimSpace(cssclass.value);
|
||||
if (cssclassValue !== '') {
|
||||
modifyTable.className = cssclassValue;
|
||||
}
|
||||
else {
|
||||
modifyTable.removeAttribute('class');
|
||||
}
|
||||
|
||||
cssid = document.getElementById('cssId');
|
||||
cssidValue = oEditor.trimSpace(cssid.value);
|
||||
if (cssidValue !== '') {
|
||||
modifyTable.id = cssidValue;
|
||||
}
|
||||
else {
|
||||
modifyTable.removeAttribute('id');
|
||||
}
|
||||
|
||||
var caption = document.getElementById('tableCaption');
|
||||
var captionValue = oEditor.trimSpace(caption.value);
|
||||
var summary = document.getElementById('tableSummary');
|
||||
var summaryValue = oEditor.trimSpace(summary.value);
|
||||
var oCaption;
|
||||
|
||||
if (summaryValue !== '') {
|
||||
modifyTable.setAttribute('summary', summaryValue);
|
||||
}
|
||||
if (captionValue !== '') {
|
||||
var hideCaption, tableCaption;
|
||||
tableCaption = modifyTable.createCaption();
|
||||
tableCaption.innerHTML = captionValue;
|
||||
|
||||
hideCaption = document.getElementById('hideCaption');
|
||||
if (hideCaption.checked === true) {
|
||||
tableCaption.style.visibility = 'hidden';
|
||||
tableCaption.style.overFlow = 'hidden';
|
||||
tableCaption.style.lineHeight = '0px';
|
||||
tableCaption.style.position = 'absolute';
|
||||
tableCaption.style.display = 'none';
|
||||
}
|
||||
else {
|
||||
tableCaption.removeAttribute('style');
|
||||
}
|
||||
}
|
||||
else {
|
||||
oCaption = modifyTable.getElementsByTagName('caption')[0];
|
||||
if (oCaption) {
|
||||
modifyTable.removeChild(oCaption);
|
||||
}
|
||||
}
|
||||
|
||||
var copyAttribute = function(target, source) {
|
||||
var attr, attrValue, nodeName;
|
||||
attr = source.attributes;
|
||||
for (i=0; i<attr.length; i++) {
|
||||
nodeName = attr[i].nodeName;
|
||||
if (nodeName === 'style') {
|
||||
attrValue = source.getAttribute(nodeName);
|
||||
target.style.cssText = oEditor.undefined(attrValue.cssText) ? attrValue : attrValue.cssText;
|
||||
}
|
||||
else if (nodeName === 'class' || nodeName === 'id' || nodeName === 'nowrap' || nodeName === 'colspan' ||
|
||||
nodeName === 'rowspan' || nodeName === 'align')
|
||||
{
|
||||
attrValue = source.getAttribute(nodeName);
|
||||
if (attrValue) {
|
||||
target.setAttribute(nodeName, attrValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var copyChildNodes = function (target, source) {
|
||||
var child;
|
||||
child = source.firstChild;
|
||||
while (child) {
|
||||
target.appendChild(child);
|
||||
child = source.firstChild;
|
||||
}
|
||||
};
|
||||
|
||||
var tableHeader = document.getElementById('tableHeader').value;
|
||||
var replaceCol = function (rows, newTagName) {
|
||||
var cellLength, newCell, oldCell, newCells=[], oHead;
|
||||
row = rows[0];
|
||||
cellLength = row.cells.length;
|
||||
|
||||
for (i=0; i < cellLength; i++) {
|
||||
oldCell = row.cells[i];
|
||||
newCell = document.createElement(newTagName);
|
||||
copyAttribute(newCell, oldCell);
|
||||
copyChildNodes(newCell, oldCell);
|
||||
|
||||
if (newTagName === 'th') {
|
||||
newCell.setAttribute('scope', 'col');
|
||||
}
|
||||
else {
|
||||
newCell.removeAttribute('scope');
|
||||
}
|
||||
|
||||
newCells.push(newCell);
|
||||
}
|
||||
|
||||
for (j = cellLength-1; j >= 0; j--) {
|
||||
row.deleteCell(j);
|
||||
}
|
||||
|
||||
for (j=0; j < newCells.length; j++) {
|
||||
row.appendChild(newCells[j]);
|
||||
}
|
||||
|
||||
if (newTagName === 'th') {
|
||||
oHead = modifyTable.getElementsByTagName('thead')[0];
|
||||
if (!oHead) {
|
||||
oHead = document.createElement('thead');
|
||||
modifyTable.insertBefore(oHead, modifyTable.firstChild);
|
||||
oHead.appendChild(row);
|
||||
}
|
||||
}
|
||||
else if (row.parentNode.nodeName.toLowerCase() === 'thead') {
|
||||
oHead = row.parentNode;
|
||||
if (rows[1]) {
|
||||
rows[1].parentNode.insertBefore(row, rows[1]);
|
||||
}
|
||||
else {
|
||||
modifyTable.insertBefore(row, oHead);
|
||||
}
|
||||
modifyTable.removeChild(oHead);
|
||||
}
|
||||
};
|
||||
|
||||
var replaceRow = function (rows, newTagName) {
|
||||
var len, newCell, sourceCell;
|
||||
len = rows.length;
|
||||
for (i=0; i < len; i++) {
|
||||
row = rows[i];
|
||||
sourceCell = row.cells[0];
|
||||
newCell = document.createElement(newTagName);
|
||||
|
||||
if (newTagName === 'th') {
|
||||
newCell.setAttribute('scope', 'row');
|
||||
}
|
||||
else {
|
||||
sourceCell.removeAttribute('scope');
|
||||
}
|
||||
|
||||
row.insertBefore(newCell, sourceCell);
|
||||
copyAttribute(newCell, sourceCell);
|
||||
copyChildNodes(newCell, sourceCell);
|
||||
row.deleteCell(1);
|
||||
}
|
||||
};
|
||||
|
||||
var border, borderValue;
|
||||
if (beforeHeaderType !== tableHeader) {
|
||||
rows = (modifyTable.rows && modifyTable.rows.length > 0) ?
|
||||
modifyTable.rows :
|
||||
modifyTable.getElementsByTagName('tr');
|
||||
|
||||
if (tableHeader === 'col') {
|
||||
replaceRow(rows, 'td');
|
||||
replaceCol(rows, 'th');
|
||||
}
|
||||
else if (tableHeader === 'row') {
|
||||
replaceCol(rows, 'td');
|
||||
replaceRow(rows, 'th');
|
||||
}
|
||||
else if (tableHeader === 'all') {
|
||||
replaceCol(rows, 'th');
|
||||
replaceRow(rows, 'th');
|
||||
}
|
||||
else if (tableHeader === 'none') {
|
||||
replaceCol(rows, 'td');
|
||||
replaceRow(rows, 'td');
|
||||
}
|
||||
|
||||
oCaption = modifyTable.getElementsByTagName('caption')[0];
|
||||
if (oCaption && oCaption !== modifyTable.firstChild) {
|
||||
modifyTable.insertBefore(oCaption, modifyTable.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
border = document.getElementById("bordersize");
|
||||
if (border) {
|
||||
borderValue = oEditor.trimSpace(border.value);
|
||||
if (isNaN(borderValue) === false) {
|
||||
var borderColor, borderColorValue;
|
||||
borderValue = parseInt(borderValue, 10);
|
||||
rows = (modifyTable.rows && modifyTable.rows.length > 0) ?
|
||||
modifyTable.rows :
|
||||
modifyTable.getElementsByTagName('tr');
|
||||
|
||||
if (borderValue) {
|
||||
borderColor = document.getElementById("idbordercolor");
|
||||
if (borderColor) {
|
||||
borderColorValue = oEditor.trimSpace(borderColor.value);
|
||||
}
|
||||
if (!borderColorValue || borderColorValue === none) {
|
||||
borderColorValue = '#000000';
|
||||
}
|
||||
|
||||
borderColorValue = oEditor.colorConvert(borderColorValue, 'rgb');
|
||||
|
||||
modifyTable.style.border = borderValue + 'px solid ' + borderColorValue;
|
||||
modifyTable.style.borderCollapse = "collapse";
|
||||
modifyTable.removeAttribute('border');
|
||||
|
||||
for (i=0; i < rows.length; i++) {
|
||||
row = rows[i];
|
||||
for (j=0; j < row.cells.length; j++) {
|
||||
cell = row.cells[j];
|
||||
cell.style.border = borderValue + 'px solid ' + borderColorValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (borderValue === 0) {
|
||||
modifyTable.removeAttribute('border');
|
||||
modifyTable.style.border = '';
|
||||
modifyTable.style.borderCollapse = '';
|
||||
for (i=0; i < rows.length; i++) {
|
||||
row = rows[i];
|
||||
for (j=0; j < row.cells.length; j++) {
|
||||
cell = row.cells[j];
|
||||
cell.style.border = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oEditor.editArea.focus();
|
||||
oEditor.backupRange(oEditor.restoreRange());
|
||||
oEditor.clearStoredSelections();
|
||||
oEditor.popupWinClose();
|
||||
}
|
||||
70
plugin/editor/cheditor5/popup/link.html
Normal file
70
plugin/editor/cheditor5/popup/link.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/link.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content-outline">
|
||||
<form name="set" id="fm_set" action="javascript:void%200">
|
||||
<input type="hidden" value="" name="SelTxt" />
|
||||
<table style="border: 0; padding: 0; border-spacing: 0;">
|
||||
<tr>
|
||||
<td>
|
||||
<table style="border: none; border-spacing: 4px">
|
||||
<tr>
|
||||
<td style="text-align:right; width:50px"><span class="font-normal">유형:</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="protocol" id="fm_protocol" onchange="updateProtocol()">
|
||||
<option value="http://" selected="selected">http</option>
|
||||
<option value="https://">https</option>
|
||||
<option value="mailto:">mailto</option>
|
||||
<option value="file://">file</option>
|
||||
<option value="ftp://">ftp</option>
|
||||
<option value="gopher://">gopher</option>
|
||||
<option value="news:">news</option>
|
||||
<option value="telnet:">telnet</option>
|
||||
<option value="wias:">wias</option>
|
||||
<option value="javascript:">javascript</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;"><span class="font-normal">타겟:</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="target" id="fm_target">
|
||||
<option value="">없음</option>
|
||||
<option value="_self">_self</option>
|
||||
<option value="_blank" selected="selected">_blank</option>
|
||||
<option value="_parent">_parent</option>
|
||||
<option value="_top">_top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:right"><span class="font-normal">URL:</span>
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="link_value" id="fm_link_value" value="http://" size="40" spellcheck="false" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:right"><span class="font-normal">타이틀:</span>
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="title" id="fm_title" value="" size="40" spellcheck="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
40
plugin/editor/cheditor5/popup/media.html
Normal file
40
plugin/editor/cheditor5/popup/media.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/media.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<form action="" name="insertImage">
|
||||
<fieldset><legend><span class="font-normal">미디어 재생</span></legend>
|
||||
<table style="width: 100%; border: none; padding: 0; border-spacing: 0;">
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<div id="play" class="media-player-wrapper"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset><legend><span class="font-normal">미디어 파일 URL</span></legend>
|
||||
<table style="width: 100%; border: none; padding: 4px; border-spacing: 0;">
|
||||
<tr>
|
||||
<td>
|
||||
<span class="font-normal">URL 입력:</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="linkurl" id="fm_linkurl" size="50" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
26
plugin/editor/cheditor5/popup/symbol.html
Normal file
26
plugin/editor/cheditor5/popup/symbol.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/symbol.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body style="line-height:100%">
|
||||
<label id="s1">일반</label> <span class="font-normal">|</span>
|
||||
<label id="s2">괘선</label> <span class="font-normal">|</span>
|
||||
<label id="s3">숫자, 단위</label> <span class="font-normal">|</span>
|
||||
<label id="s4">한글 고어</label> <span class="font-normal">|</span>
|
||||
<label id="s5">원 문자</label> <span class="font-normal">|</span>
|
||||
<label id="s6">일본어</label>
|
||||
<div class="spacer5"></div>
|
||||
<div id="output" style="visibility:hidden"></div>
|
||||
<div class="spacer"></div>
|
||||
<div class="font-normal" style="text-align:left">
|
||||
선택한 문자: <input type="text" id="fm_input" style="border:1px #d4d4d4 solid;font-size:9pt;width:280px" readonly=true />
|
||||
</div>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
</body>
|
||||
</html>
|
||||
178
plugin/editor/cheditor5/popup/table.html
Normal file
178
plugin/editor/cheditor5/popup/table.html
Normal file
@ -0,0 +1,178 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/table.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<fieldset><legend><span class="font-normal">표 속성</span></legend>
|
||||
<div>
|
||||
<table cellspacing="0" border="0" cellpadding="2" width="100%">
|
||||
<tr>
|
||||
<td width="20%"><span class="font-normal">줄 수:</span>
|
||||
</td>
|
||||
<td width="30%"><input type="text" size="3" name="numrows" id="numrows" value="3" />
|
||||
</td>
|
||||
<td width="20%"><span class="font-normal">칸 수:</span>
|
||||
</td>
|
||||
<td width="30%"><input type="text" size="3" name="numcols" id="numcols" value="2" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">너비:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" size="3" name="width" id="width" value="100" />
|
||||
<select name="widthtype" id="widthtype">
|
||||
<option value="%" selected="selected">%</option>
|
||||
<option value="px">px</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><span class="font-normal">높이:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" size="3" name="height" id="height" value="" />
|
||||
<select name="heighttype" id="heighttype">
|
||||
<option value="%">%</option>
|
||||
<option value="px" selected="selected">px</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">셀 안 여백:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="cellpd" id="cellpd" value="1" />
|
||||
</td>
|
||||
<td><span class="font-normal">셀 간격:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="cellsp" id="cellsp" value="0" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">테두리 굵기:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="bordersize" id="bordersize" value="1" /> <span class="font-normal">픽셀</span>
|
||||
</td>
|
||||
<td><span class="font-normal">정렬:</span>
|
||||
</td>
|
||||
<td><select id="talign" name="talign">
|
||||
<option value="none" selected="selected">없음</option>
|
||||
<option value="left">왼쪽</option>
|
||||
<option value="center">가운데</option>
|
||||
<option value="right">오른쪽</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">표 제목:</span>
|
||||
</td>
|
||||
<td colspan="2"><input type="text" size="27" name="caption" id="tableCaption" value="" />
|
||||
</td>
|
||||
<td><span class="font-normal">표 제목 숨김:</span><input type="checkbox" id="hideCaption" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">표 요약:</span>
|
||||
</td>
|
||||
<td colspan="2"><input type="text" size="27" name="summary" id="tableSummary" value="" />
|
||||
</td>
|
||||
<td><span class="font-normal">표 헤더:</span>
|
||||
<select id="tableHeader" name="header">
|
||||
<option value="none">없음</option>
|
||||
<option value="col">첫 줄</option>
|
||||
<option value="row">첫 칸</option>
|
||||
<option value="all">모두</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">CSS class:</span>
|
||||
</td>
|
||||
<td><input type="text" size="10" name="cssClass" id="cssClass" value="" />
|
||||
</td>
|
||||
<td><span class="font-normal">CSS id:</span>
|
||||
</td>
|
||||
<td><input type="text" size="10" name="cssId" id="cssId" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset><legend><span class="font-normal">색 지정</span></legend>
|
||||
<div id="tableColorWrapper">
|
||||
<table cellspacing="0" width="100%" border="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="20%"><span class="font-normal">테두리 색:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<div style="float:left">
|
||||
<input type="text" size="10" name="idbordercolor" id="idbordercolor" value="#000000" class="colorInputBox" />
|
||||
</div>
|
||||
<div class="colorPickerButton" onclick="showColorPicker('bordercolor', this);"> </div>
|
||||
</td>
|
||||
<td width="20%"><span class="font-normal">표 배경색:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<div style="float:left">
|
||||
<input type="text" size="10" name="idbgcolor" id="idbgcolor" value="없음" class="colorInputBox" style="background-color:#fff" />
|
||||
</div>
|
||||
<div class="colorPickerButton" onclick="showColorPicker('bgcolor', this);"> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="colorWrapper" class="colorWrapper"></div>
|
||||
</fieldset>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
<script type="text/javascript">
|
||||
var offsetTop, offsetLeft, obj, showColorSwitch=false, showColorSwitch=false, beforeButton=null, tableColorWrapper, colorPickerWrapper;
|
||||
window.onload = function() {
|
||||
tableColorWrapper = document.getElementById('tableColorWrapper');
|
||||
colorPickerWrapper = document.getElementById('colorWrapper');
|
||||
obj = tableColorWrapper;
|
||||
offsetTop = obj.offsetTop;
|
||||
offsetLeft = obj.offsetLeft;
|
||||
if (obj.offsetParent) {
|
||||
obj = obj.offsetParent;
|
||||
while (obj) {
|
||||
offsetTop += obj.offsetTop;
|
||||
offsetLeft += obj.offsetLeft;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
}
|
||||
colorPickerWrapper.style.top = (offsetTop-74) + 'px';
|
||||
colorPickerWrapper.style.left = offsetLeft + 'px';
|
||||
drawColor();
|
||||
};
|
||||
|
||||
function showColorPicker(which, img) {
|
||||
showColorSwitch = !showColorSwitch;
|
||||
if (beforeButton && beforeButton !== img) {
|
||||
beforeButton.className = 'colorPickerButton';
|
||||
showColorSwitch = true;
|
||||
}
|
||||
if (showColorSwitch) {
|
||||
displayAttr = 'block';
|
||||
img.className = 'colorPickerButtonGray';
|
||||
if (beforeButton === null || beforeButton !== img) {
|
||||
beforeButton = img;
|
||||
}
|
||||
setColor(which);
|
||||
}
|
||||
else {
|
||||
img.className = 'colorPickerButton';
|
||||
displayAttr = 'none';
|
||||
}
|
||||
document.getElementById('colorWrapper').style.display = displayAttr;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
180
plugin/editor/cheditor5/popup/table_modify.html
Normal file
180
plugin/editor/cheditor5/popup/table_modify.html
Normal file
@ -0,0 +1,180 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>CHEditor</title>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||
<script src="js/dialog.js" type="text/javascript"></script>
|
||||
<script src="js/table_modify.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<fieldset><legend><span class="font-normal">표 속성</span></legend>
|
||||
<div>
|
||||
<table cellspacing="0" width="100%" border="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="20%"><span class="font-normal">줄 수:</span>
|
||||
</td>
|
||||
<td width="30%"><span id="numrows" class="font-normal"></span>
|
||||
</td>
|
||||
<td width="20%"><span class="font-normal">칸 수:</span>
|
||||
</td>
|
||||
<td width="30%"><span id="numcols" class="font-normal"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td width="20%"><span class="font-normal">너비:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<input type="text" size="3" name="width" id="width" value="100" />
|
||||
<select name="widthtype" id="widthtype">
|
||||
<option value="%" selected="selected">%</option>
|
||||
<option value="px">px</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="20%"><span class="font-normal">높이:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<input type="text" size="3" name="height" id="height" value="" />
|
||||
<select name="heighttype" id="heighttype">
|
||||
<option value="%">%</option>
|
||||
<option value="px" selected="selected">px</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">셀 안 여백:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="cellpd" id="cellpd" value="3" />
|
||||
</td>
|
||||
<td><span class="font-normal">셀 간격:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="cellsp" id="cellsp" value="0" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">테두리 굵기:</span>
|
||||
</td>
|
||||
<td><input type="text" size="3" name="bordersize" id="bordersize" value="1" />
|
||||
</td>
|
||||
<td><span class="font-normal">정렬:</span>
|
||||
</td>
|
||||
<td><select id="talign" name="talign">
|
||||
<option value="none" selected="selected">없음</option>
|
||||
<option value="left">왼쪽</option>
|
||||
<option value="center">가운데</option>
|
||||
<option value="right">오른쪽</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td width="50"><span class="font-normal">표 제목:</span>
|
||||
</td>
|
||||
<td colspan="2"><input type="text" size="27" name="caption" id="tableCaption" value="" />
|
||||
</td>
|
||||
<td><span class="font-normal">표 제목 숨김:</span>
|
||||
<input type="checkbox" id="hideCaption" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="50"><span class="font-normal">표 요약:</span>
|
||||
</td>
|
||||
<td colspan="2"><input type="text" size="27" name="summary" id="tableSummary" value="" />
|
||||
</td>
|
||||
|
||||
<td><span class="font-normal">표 헤더:</span>
|
||||
<select id="tableHeader" name="header">
|
||||
<option value="none">없음</option>
|
||||
<option value="col">첫 줄</option>
|
||||
<option value="row">첫 칸</option>
|
||||
<option value="all">모두</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><hr class="hr" noshade="noshade" /></td></tr>
|
||||
<tr>
|
||||
<td><span class="font-normal">CSS class:</span>
|
||||
</td>
|
||||
<td><input type="text" size="10" name="cssClass" id="cssClass" value="" />
|
||||
</td>
|
||||
<td><span class="font-normal">CSS id:</span>
|
||||
</td>
|
||||
<td><input type="text" size="10" name="cssId" id="cssId" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset><legend><span class="font-normal">색 지정</span></legend>
|
||||
<div id="tableColorWrapper">
|
||||
<table cellspacing="0" width="100%" border="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="20%"><span class="font-normal">테두리 색:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<div style="float:left">
|
||||
<input type="text" size="10" name="idbordercolor" id="idbordercolor" value="#000000" class="colorInputBox" />
|
||||
</div>
|
||||
<div class="colorPickerButton" onclick="showColorPicker('bordercolor', this);"> </div>
|
||||
</td>
|
||||
<td width="20%"><span class="font-normal">표 배경색:</span>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<div style="float:left">
|
||||
<input type="text" size="10" name="idbgcolor" id="idbgcolor" value="없음" class="colorInputBox" style="background-color:#fff" />
|
||||
</div>
|
||||
<div class="colorPickerButton" onclick="showColorPicker('bgcolor', this);"> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="colorWrapper" class="colorWrapper"></div>
|
||||
</fieldset>
|
||||
<div class="bottom-status" id="buttonWrapper"></div>
|
||||
<script type="text/javascript">
|
||||
var offsetTop, offsetLeft, obj, showColorSwitch=false, showColorSwitch=false, beforeButton=null, tableColorWrapper, colorPickerWrapper;
|
||||
window.onload = function() {
|
||||
tableColorWrapper = document.getElementById('tableColorWrapper');
|
||||
colorPickerWrapper = document.getElementById('colorWrapper');
|
||||
obj = tableColorWrapper;
|
||||
offsetTop = obj.offsetTop;
|
||||
offsetLeft = obj.offsetLeft;
|
||||
if (obj.offsetParent) {
|
||||
obj = obj.offsetParent;
|
||||
while (obj) {
|
||||
offsetTop += obj.offsetTop;
|
||||
offsetLeft += obj.offsetLeft;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
}
|
||||
colorPickerWrapper.style.top = (offsetTop-74) + 'px';
|
||||
colorPickerWrapper.style.left = offsetLeft + 'px';
|
||||
drawColor();
|
||||
};
|
||||
|
||||
function showColorPicker(which, img) {
|
||||
showColorSwitch = !showColorSwitch;
|
||||
if (beforeButton && beforeButton !== img) {
|
||||
beforeButton.className = 'colorPickerButton';
|
||||
showColorSwitch = true;
|
||||
}
|
||||
if (showColorSwitch) {
|
||||
displayAttr = 'block';
|
||||
img.className = 'colorPickerButtonGray';
|
||||
if (beforeButton === null || beforeButton !== img) {
|
||||
beforeButton = img;
|
||||
}
|
||||
setColor(which);
|
||||
}
|
||||
else {
|
||||
img.className = 'colorPickerButton';
|
||||
displayAttr = 'none';
|
||||
}
|
||||
document.getElementById('colorWrapper').style.display = displayAttr;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user