git-svn-id: http://xe-core.googlecode.com/svn/trunk@478 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-16 03:37:43 +00:00
parent f0f9a02f73
commit bb1dc4cc26
81 changed files with 0 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,183 @@
div.editor_content {
margin:3px;
}
div.editor_fontbox {
margin : 3px 3px 3px 0px;
float:left;
}
div.editor_fontbox select {
width:70px;
height:18px;
}
div.editor_iconbox {
margin : 3px 3px 3px 0px;
white-space:nowrap;
font-size:1pt;
float:left;
}
div.editor_iconbox img {
width : 16px;
height : 16px;
border : 1px solid #EEEEEE;
background-color : #FFFFFF;
padding:1px;
cursor : pointer;
margin-right:1px;
}
div.editor_parabox {
margin : 3px 3px 3px 0px;
font-size:9pt;
text-align:right;
display:none;
float:right;
}
div.editor_iframe_box {
clear:left;
border:1px solid #EFEFEF;
margin:3px 0px 0px 0px;
}
div.editor_drag_down_area {
width:100%;
height:15px;
background:url(../images/icon_drag_down.gif) no-repeat center;
background-color:#EFEFEF;
cursor:s-resize;
position:relative;
margin-top:10px;
}
.editor_pop_body {
padding:4px 4px 4px 4px;
margin:0px;
border:0px;
background-color:#FFFFFF;
}
.editor_window {
background-color : #EFEFEF;
}
textarea.editor_small_textarea {
font-family:tahoma;
border : 1px solid #CCCCCC;
background-color : #FFFFFF;
font-size : 8pt;
width:99%;
height:100px;
}
textarea.editor_textarea {
font-family:tahoma;
border : 1px solid #CCCCCC;
background-color : #FFFFFF;
font-size : 8pt;
width:100%;
height:450px;
}
input.editor_submit {
border : 1px solid #555555;
background-color : #AAAAAA;
color : #000000;
font-weight:bold;
font-family:verdana;
width : 100%;
height : 20px;
font-size : 8pt;
}
div.quotation_box {
font-size:8pt;
font-family:tahoma;
margin-bottom:8px;
padding-bottom:5px;
border-bottom:1px dotted #AAAAAA;
}
#quotation th { width:80px; font-size:8pt; font-family:tahoma; }
img.color_icon {
width:15px;
height:15px;
border:1px solid #FFFFFF;
}
img.color_icon_over {
width:15px;
height:15px;
border:1px solid #000000;
cursor:pointer;
}
td.editor_field {
font-family:tahoma;
font-size:8pt;
font-weight:bold;
background-color : #CCCCCC;
text-align : center;
}
input.editor_input {
font-family:tahoma;
border : 1px solid #CCCCCC;
background-color : #FFFFFF;
width : 330px;
height : 18px;
padding : 1px;
font-size : 8pt;
}
.editor_uploader_box {
margin:10px 0px 0px 0px;
border:0px;
padding:0px;
clear:both;
}
.editor_uploader {
margin-right:10px;
padding-right:5px;
border-right:1px dotted #AAAAAA;
width:255px;
float:left;
}
.uploaded_file_list {
width:250px;
height:120px;
}
.editor_component {
float:left;
}
.uploaded_file_preview_box {
border:1px solid #EEEEEE;
width:120px;
height:120px;
float:left;
margin-right:10px;
}
.editor_align_icon {
margin:0px 0px 6px 5px;
font-size:9pt;
}
.editor_align_icon img {
vertical-align:middle;
cursor:pointer;
}
img.editor_multimedia {
background:url(../images/multimedia_icon.gif) no-repeat center;
background-color:#FFFFFF;
border:2px dotted #B7AD10;
}

View file

@ -0,0 +1,106 @@
<!--%import("./js/editor.js")-->
<!--%import("./css/editor.css")-->
<!--%import("./lang")-->
<!-- 에디터 활성화 -->
<script type="text/javascript">
var editor_path = "./editor/";
editorInit("{$upload_target_srl}");
</script>
<!-- 에디터 -->
<div class="editor_content">
<!-- 폰트 종류와 크기 -->
<div class="editor_fontbox">
<select onChange="editorChangeFontName(this,'{$upload_target_srl}')" id="editor_font_{$upload_target_srl}">
<option value="">{$lang->edit->fontname}</option>
<!--@foreach($lang->edit->fontlist as $key=>$obj)-->
<option style="font-family:{$obj}" value="{$obj}">{$obj}</option>
<!--@end-->
</select>
<select onChange="editorChangeFontSize(this,'{$upload_target_srl}')" id="editor_fontsize_{$upload_target_srl}">
<option value="" selected>{$lang->edit->fontsize}</option>
<option value="1">8pt</option>
<option value="2">10pt</option>
<option value="3">12pt</option>
<option value="4">14pt</option>
<option value="5">18pt</option>
<option value="6">24pt</option>
<option value="7">36pt</option>
</select>
</div>
<!-- 에디팅 관련 아이콘 -->
<div class="editor_iconbox">
<img src="./images/font_color.gif" alt="{$lang->edit->help_fontcolor}" class="editor_icon" id="editor_ForeColor_{$upload_target_srl}" />
<img src="./images/font_bg_color.gif" alt="{$lang->edit->help_fontbgcolor}" class="editor_icon" id="editor_BackColor_{$upload_target_srl}" />
<img src="./images/bold.gif" alt="{$lang->edit->help_bold}" class="editor_icon" id="editor_Bold_{$upload_target_srl}" />
<img src="./images/italic.gif" alt="{$lang->edit->help_italic}" class="editor_icon" id="editor_Italic_{$upload_target_srl}" />
<img src="./images/underline.gif" alt="{$lang->edit->help_underline}" class="editor_icon" id="editor_Underline_{$upload_target_srl}" />
<img src="./images/strike.gif" alt="{$lang->edit->help_strike}" class="editor_icon" id="editor_StrikeThrough_{$upload_target_srl}" />
<img src="./images/add_url.gif" alt="{$lang->edit->help_add_url}" class="editor_icon" id="editor_addurl_{$upload_target_srl}" />
<img src="./images/add_image.gif" alt="{$lang->edit->help_add_image}" class="editor_icon" id="editor_addimage_{$upload_target_srl}" />
<img src="./images/add_multi.gif" alt="{$lang->edit->help_add_multimedia}" class="editor_icon" id="editor_addmultimedia_{$upload_target_srl}" />
<img src="./images/emoticon.gif" alt="{$lang->edit->help_add_emoticon}" class="editor_icon" id="editor_addemoticon_{$upload_target_srl}" />
<img src="./images/quotation.gif" alt="{$lang->edit->help_add_quotation}" class="editor_icon" id="editor_quotation_{$upload_target_srl}" />
<img src="./images/html_add.gif" alt="{$lang->edit->help_add_html}" class="editor_icon" id="editor_addhtml_{$upload_target_srl}" />
</div>
<div id="editor_paragraph_{$upload_target_srl}" class="editor_iconbox" style="display:none">
<img src="./images/align_left.gif" alt="{$lang->edit->help_align_left}" id="editor_justifyleft_{$upload_target_srl}" />
<img src="./images/align_center.gif" alt="{$lang->edit->help_align_center}" id="editor_justifycenter_{$upload_target_srl}" />
<img src="./images/align_right.gif" alt="{$lang->edit->help_align_right}" id="editor_justifyright_{$upload_target_srl}" />
<img src="./images/remove_indent.gif" alt="{$lang->edit->help_remove_indent}" id="editor_outdent_{$upload_target_srl}" />
<img src="./images/add_indent.gif" alt="{$lang->edit->help_add_indent}" id="editor_indent_{$upload_target_srl}" />
<img src="./images/list_number.gif" alt="list number" id="editor_insertorderedlist_{$upload_target_srl}" />
<img src="./images/list_bullet.gif" alt="list bullet" id="editor_insertunorderedlist_{$upload_target_srl}" />
</div>
<!-- IE의 경우 엔터시 p 태그를 쓸지 br 태그로 변경을 할지 체크하는 항목 -->
<div class="editor_parabox" id="editor_use_paragraph_box_{$upload_target_srl}">
<input type="checkbox" name="use_paragraph" id="editor_use_paragraph_{$upload_target_srl}" onclick="editorUseParagraph(this,'{$upload_target_srl}');" />
<label for="editor_use_paragraph_{$upload_target_srl}">{$lang->edit->use_paragraph}</label>
</div>
<!-- iframe -->
<div class="editor_iframe_box"><iframe id="editor_iframe_{$upload_target_srl}" frameBorder="0" style="border:0px;width:99%;height:300px;margin:0px;"></iframe><div class="editor_drag_down_area" id="editor_drag_bar_{$upload_target_srl}"></div></div>
</div>
<!--@if($grant->fileupload)-->
<!-- 파일 업로드는 어떤 모듈이건 $grant->fileupload가 true여야 호출된다. 필요할 모듈에서는 임의 설정 하면 됨 -->
<!--%import("./js/uploader.js")-->
<script type="text/javascript">
editor_upload_init("{$upload_target_srl}");
</script>
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<div class="editor_uploader_box">
<div class="editor_uploader">
<select id='uploaded_file_list_{$upload_target_srl}' size='9' class="uploaded_file_list" onclick="editor_preview(this, '{$upload_target_srl}')"></select><br />
<input type="file" name="file" onchange="editor_file_upload(this, '{$upload_target_srl}')" value="{$lang->edit->upload}" /><br />
<input type="button" value="{$lang->edit->delete_selected}" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
<input type="button" value="{$lang->edit->link_selected}" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
</div>
<div id="editor_component_{$upload_target_srl}" class="editor_component">
<div id="uploaded_file_preview_box_{$upload_target_srl}" class="uploaded_file_preview_box"></div>
<div>
<div class="editor_align_icon">
<img src="./images/icon_align_article.gif" border="0" onclick="editor_insert_file('{$upload_target_srl}', '');" alt="{$lang->edit->icon_align_article}"/>
{$lang->edit->icon_align_article}
</div>
<div class="editor_align_icon">
<img src="./images/icon_align_left.gif" border="0" onclick="editor_insert_file('{$upload_target_srl}', 'left');" alt="{$lang->edit->icon_align_left}"/>
{$lang->edit->icon_align_left}
</div>
<div class="editor_align_icon">
<img src="./images/icon_align_middle.gif" border="0" onclick="editor_insert_file('{$upload_target_srl}', 'middle');" alt="{$lang->edit->icon_align_middle}"/>
{$lang->edit->icon_align_middle}
</div>
<div class="editor_align_icon">
<img src="./images/icon_align_right.gif" border="0" onclick="editor_insert_file('{$upload_target_srl}', 'right');" alt="{$lang->edit->icon_align_right}"/>
{$lang->edit->icon_align_right}
</div>
</div>
</div>
</div>
<!--@end-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

488
modules/editor/tpl/js/editor.js Executable file
View file

@ -0,0 +1,488 @@
/**
* @author zero (zero@nzeo.com)
* @version 0.1
* @brief 에디터 관련 스크립트
**/
// iframe의 id prefix
var iframe_id = 'editor_iframe_';
// upload_target_srl에 대한 form문을 객체로 보관함
var editor_form_list = new Array();
// srl값에 해당하는 iframe의 object를 return
function editorGetIFrame(upload_target_srl) {
var obj_id = iframe_id+upload_target_srl;
return xGetElementById(obj_id);
}
// editor 초기화를 onload이벤트 후에 시작시킴
function editorInit(upload_target_srl) {
var start_func = function() { editorStart(upload_target_srl); }
xAddEventListener(window, 'load', start_func);
}
// editor 시작 (upload_target_srl로 iframe객체를 얻어서 쓰기 모드로 전환)
function editorStart(upload_target_srl) {
// iframe obj를 찾음
var iframe_obj = editorGetIFrame(upload_target_srl);
if(!iframe_obj) return;
// 현 에디터를 감싸고 있는 form문을 찾아서 content object를 찾아서 내용 sync
var fo_obj = iframe_obj.parentNode;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
// 구해진 form 객체를 저장
editor_form_list[upload_target_srl] = fo_obj;
// 대상 form의 content object에서 데이터를 구함
var content = fo_obj.content.value;
// 기본 폰트를 가져옴
var default_font = xGetElementById('editor_font_'+upload_target_srl).options[1].value;
// iframe내의 document object
var contentDocument = iframe_obj.contentWindow.document;
// editing가능하도록 설정 시작
// 기본 내용 작성
var contentHtml = ''+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+
'<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/>';
/********* stylesheet
for(var i in document.styleSheets) {
var tmp_obj = document.styleSheets[i];
if(typeof(tmp_obj.href)=='undefined'||tmp_obj.href.lastIndexOf(".css")<0) continue;
contentHtml += "<link rel=\"StyleSheet\" HREF=\""+tmp_obj.href+"\" type=\"text/css\" />";
}
**********/
contentHtml += "<link rel=\"stylesheet\" href=\"./common/css/common.css\" type=\"text/css\" />";
contentHtml += "<link rel=\"stylesheet\" href=\""+editor_path+"/css/editor.css\" type=\"text/css\" />";
contentHtml += ""+
"</head><body style=\"background-color:#FFFFFF;font-family:"+default_font+";font-size:9pt;\">"+
content+
"</body></html>";
contentDocument.designMode = 'on';
contentDocument.open("text/html","replace");
contentDocument.write(contentHtml);
contentDocument.close();
// 작성시 필요한 이벤트 체크
if(xIE4Up) xAddEventListener(contentDocument, 'keydown',editorKeyPress);
else xAddEventListener(contentDocument, 'keypress',editorKeyPress);
xAddEventListener(contentDocument,'mousedown',editorHideObject);
//xAddEventListener(document,'keypress',editorKeyPress);
xAddEventListener(document,'mouseup',editorEventCheck);
xAddEventListener(document,'mousedown',editorHideObject);
// 문단작성기능 on/off
if(xIE4Up) {
xDisplay('editor_paragraph_'+upload_target_srl, 'none');
xDisplay('editor_use_paragraph_box_'+upload_target_srl, 'inline');
} else {
xDisplay('editor_paragraph_'+upload_target_srl, 'block');
xDisplay('editor_use_paragraph_box_'+upload_target_srl, 'none');
}
// 에디터의 내용을 지속적으로 fo_obj.content.value에 입력
editorSyncContent(fo_obj.content, upload_target_srl);
}
var _editorSyncList = new Array();
function editorSyncContent(obj, upload_target_srl) {
_editorSyncList[_editorSyncList.length] = {field:obj, upload_target_srl:upload_target_srl}
}
function _editorSync() {
for(var i=0;i<_editorSyncList.length;i++) {
var field = _editorSyncList[i].field;
var upload_target_srl = _editorSyncList[i].upload_target_srl;
var content = editorGetContent(upload_target_srl);
if(typeof(content)=='undefined'||!content) continue;
field.value = content;
}
setTimeout(_editorSync, 1000);
}
xAddEventListener(window, 'load', _editorSync);
// 문단기능 toggle
function editorUseParagraph(obj, upload_target_srl) {
toggleDisplay('editor_paragraph_'+upload_target_srl);
}
// 에디터의 내용 return
function editorGetContent(upload_target_srl) {
var iframe_obj = editorGetIFrame(upload_target_srl);
if(!iframe_obj) return;
var html = '';
html = xInnerHtml(iframe_obj.contentWindow.document.body);
if(!html) return;
return html.trim();
}
// 에디터 내의 선택된 부분의 html 코드를 return
function editorGetSelectedHtml(upload_target_srl) {
var iframe_obj = editorGetIFrame(upload_target_srl);
if(xIE4Up) {
var range = iframe_obj.contentWindow.document.selection.createRange();
var html = range.htmlText;
range.select();
return html;
} else {
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
var dummy = xCreateElement('div');
dummy.appendChild(range.cloneContents());
var html = xInnerHtml(dummy);
return html;
}
}
// 에디터 내의 선택된 부분의 html코드를 변경
function editorReplaceHTML(iframe_obj, html) {
iframe_obj.contentWindow.focus();
if(xIE4Up) {
var range = iframe_obj.contentWindow.document.selection.createRange();
range.pasteHTML(html);
} else {
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
range.deleteContents();
range.insertNode(range.createContextualFragment(html));
}
}
// 입력 키에 대한 이벤트 체크
function editorKeyPress(evt) {
var e = new xEvent(evt);
if (e.keyCode == 13) {
if(xIE4Up && e.shiftKey == false && !xGetElementById("use_paragraph").checked ) {
if(e.target.parentElement.document.designMode!="On") return;
var obj = e.target.parentElement.document.selection.createRange();
obj.pasteHTML('<br />');
obj.select();
evt.cancelBubble = true;
evt.returnValue = false;
return;
}
}
if (e.ctrlKey) {
switch(e.keyCode) {
case 98 : // b
editorDo('Bold',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
case 105 : // i
editorDo('Italic',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
case 117 : // u
editorDo('Underline',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
case 83 : // s
case 115 : // s
editorDo('StrikeThrough',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
}
}
}
// 에디터 상단의 버튼 클릭시 action 처리
var editorPrevObj = null;
var editorPrevSrl = null;
function editorEventCheck(evt) {
var e = new xEvent(evt);
var target_id = e.target.id;
if(target_id.indexOf('editor_')!=-1) {
var tmp_str = target_id.split('_');
var method_name = tmp_str[1];
var upload_target_srl = tmp_str[2];
switch(method_name) {
case 'Bold' :
case 'Italic' :
case 'Underline' :
case 'StrikeThrough' :
case 'justifyleft' :
case 'justifycenter' :
case 'justifyright' :
case 'indent' :
case 'outdent' :
case 'insertorderedlist' :
case 'insertunorderedlist' :
editorDo(method_name, '', upload_target_srl);
break;
default :
editorPrevSrl = upload_target_srl;
switch(method_name) {
case "addemoticon" :
var x = (screen.availWidth - 225)/2;
var y = (screen.availHeight - 150)/2;
winopen(editor_path+"popup/add_emoticon.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "quotation" :
var x = (screen.availWidth - 400)/2;
var y = (screen.availHeight - 400)/2;
winopen(editor_path+"popup/add_quotation.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "addurl" :
var x = (screen.availWidth - 400)/2;
var y = (screen.availHeight - 220)/2;
winopen(editor_path+"popup/add_url.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "addimage" :
var x = (screen.availWidth - 420)/2;
var y = (screen.availHeight - 80)/2;
winopen(editor_path+"popup/add_image.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "addmultimedia" :
var x = (screen.availWidth - 400)/2;
var y = (screen.availHeight - 220)/2;
winopen(editor_path+"popup/add_multi.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "addhtml" :
var x = (screen.availWidth - 400)/2;
var y = (screen.availHeight - 500)/2;
winopen(editor_path+"popup/add_html.php","_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
break;
case "ForeColor" :
case "BackColor" :
var x = (screen.availWidth - 145)/2;
var y = (screen.availHeight - 95)/2;
winopen(editor_path+"popup/color_box.php?mode="+method_name,"_editorPopup","top="+y+",left="+x+",width=50,height=50,resizable=no,toolbars=no,scrollbars=no");
return;
}
break;
}
}
return;
}
// focus
function editorFocus(upload_target_srl) {
var iframe_obj = editorGetIFrame(upload_target_srl);
iframe_obj.contentWindow.focus();
}
// 편집 기능 실행
function editorDo(name, value, target) {
if(typeof(target)=='object') _editorDoObject(name, value, target);
else _editorDoSrl(name, value, target);
}
function _editorDoSrl(name, value, upload_target_srl) {
var iframe_obj = editorGetIFrame(upload_target_srl);
editorFocus(upload_target_srl);
if(xIE4Up) iframe_obj.contentWindow.document.execCommand(name, false, value);
else iframe_obj.contentWindow.document.execCommand(name, false, value);
editorFocus(upload_target_srl);
}
function _editorDoObject(name, value, obj) {
if(xIE4Up) {
obj.parentElement.document.execCommand(name, false, value);
} else {
obj.parentNode.execCommand(name, false, value);
}
}
function editorHideObject(evt) {
if(!editorPrevObj) return;
var e = new xEvent(evt);
var tobj = e.target;
while(tobj) {
if(tobj.id == editorPrevObj.id) {
return;
}
tobj = xParent(tobj);
}
editorPrevObj.style.visibility = 'hidden';
editorPrevObj = null;
return;
}
function editorChangeFontName(obj,srl) {
var value = obj.options[obj.selectedIndex].value;
if(!value) return;
editorDo('FontName',value,srl);
obj.selectedIndex = 0;
}
function editorChangeFontSize(obj,srl) {
var value = obj.options[obj.selectedIndex].value;
if(!value) return;
editorDo('FontSize',value,srl);
obj.selectedIndex = 0;
}
function editorSetForeColor(color_code) {
editorDo("ForeColor",color_code,editorPrevSrl);
editorPrevObj.style.visibility = 'hidden';
editorFocus(editorPrevSrl);
}
function editorSetBackColor(color_code) {
if(xIE4Up) editorDo("BackColor",color_code,editorPrevSrl);
else editorDo("hilitecolor",color_code,editorPrevSrl);
editorFocus(editorPrevSrl);
}
function editorInsertEmoticon(obj) {
editorFocus(editorPrevSrl);
editorDo("InsertImage",obj.src,editorPrevSrl);
editorFocus(editorPrevSrl);
}
function editorDoInsertUrl(link, upload_target_srl) {
editorFocus(upload_target_srl);
var iframe_obj = editorGetIFrame(srl);
editorReplaceHTML(iframe_obj, link);
}
function editorInsertUrl(text, url, link_type) {
if(!text || !url) return;
//if(!/^(http|ftp)/i.test(url)) url = 'http://'+url;
var link = '';
if(!link_type) link = "<a href=\""+url+"\" target=\"_blank\">"+text+"</a>";
else link = "<a href=\""+url+"\" class=\""+link_type+"\" style='text-decoration:none;' target=\"_blank\">"+text+"</a>";
editorFocus(editorPrevSrl);
var obj = editorGetIFrame(editorPrevSrl)
editorReplaceHTML(obj, link);
}
function editorInsertImage(url, src_align) {
if(!url) return;
//if(!/^(http|ftp)/i.test(url)) url = 'http://'+url;
editorFocus(editorPrevSrl);
var html = "<img src=\""+url+"\" border=\"0\" alt=\"i\" ";
if(typeof(src_align)!='undefined'&&src_align) html += " align=\""+src_align+"\"";
html += " />";
var obj = editorGetIFrame(editorPrevSrl);
editorReplaceHTML(obj, html);
}
function editorGetMultimediaHtml(url, width, height, source_filename) {
if(typeof(width)=='undefined'||!width) width = 540;
if(typeof(height)=='undefined'||!height) height= 420;
var type = "application/x-mplayer2";
var pluginspace = "http://www.microsoft.com/Windows/MediaPlayer/";
var kind = 'movie';
if(/\.swf$/i.test(url)) kind = 'flash';
if(typeof(source_filename)!='undefined' && /\.swf$/i.test(source_filename)) kind = 'flash';
if(kind=='flash') {
type = "application/x-shockwave-flash";
pluginspace = "http://www.macromedia.com/go/getflashplayer";
}
var html = "<embed src=\""+url+"\" width=\""+width+"\" height=\""+height+"\" autostart=\"0\" type=\""+type+"\" pluginspage=\""+pluginspace+"\"></embed><BR />";
return html;
}
function editorInsertMultimedia(url, width, height) {
if(url) {
var html = editorGetMultimediaHtml(url, width, height);
editorFocus(editorPrevSrl);
var obj = editorGetIFrame(editorPrevSrl)
editorReplaceHTML(obj, html);
editorFocus(editorPrevSrl);
}
}
function editorInsertHTML(html) {
if(!html) return;
editorFocus(editorPrevSrl);
var obj = editorGetIFrame(editorPrevSrl)
editorReplaceHTML(obj, html);
editorFocus(editorPrevSrl);
}
function editorInsertQuotation(html) {
if(!html) return;
if(!xIE4Up) html += "<br />";
editorFocus(editorPrevSrl);
var obj = editorGetIFrame(editorPrevSrl)
editorReplaceHTML(obj, html);
editorFocus(editorPrevSrl);
}
function editorHighlight(ret_obj, response_tags, obj) {
var html = ret_obj['html'];
html = "<div class='php_code'>"+html+"</div>";
if(!xIE4Up) html += "<br />";
editorReplaceHTML(obj, html);
}
/**
* iframe 드래그 관련
**/
var editorDragObj = {isDrag:false, y:0, obj:null, id:'', det:0}
xAddEventListener(document, 'mousedown', editorDragStart);
xAddEventListener(document, 'mouseup', editorDragStop);
function editorDragStart(evt) {
var e = new xEvent(evt);
var obj = e.target;
if(typeof(obj.id)=='undefined'||!obj.id) return;
var id = obj.id;
if(id.indexOf('editor_drag_bar_')!=0) return;
editorDragObj.isDrag = true;
editorDragObj.y = e.pageY;
editorDragObj.obj = e.target;
editorDragObj.id = id.substr('editor_drag_bar_'.length);
xAddEventListener(document, 'mousemove', editorDragMove, false);
xAddEventListener(editorDragObj.obj, 'mouseout', editorDragMove, false);
var iframe_obj = editorGetIFrame(editorDragObj.id);
if(iframe_obj) xAddEventListener(iframe_obj.contentWindow.document, 'mouseover', editorDragStop, false);
}
function editorDragMove(evt) {
if(!editorDragObj.isDrag) return;
var e = new xEvent(evt);
var h = e.pageY - editorDragObj.y;
editorDragObj.y = e.pageY;
var iframe_obj = editorGetIFrame(editorDragObj.id);
xHeight(iframe_obj, xHeight(iframe_obj)+h);
}
function editorDragStop(evt) {
if(!editorDragObj.isDrag) return;
xRemoveEventListener(document, 'mousemove', editorDragMove, false);
xRemoveEventListener(editorDragObj.obj, 'mouseout', editorDragMove, false);
var iframe_obj = editorGetIFrame(editorDragObj.id);
if(iframe_obj) xRemoveEventListener(iframe_obj.contentWindow.document, 'mouseover', editorDragStop, false);
editorDragObj.isDrag = false;
editorDragObj.y = 0;
editorDragObj.obj = null;
editorDragObj.id = '';
}

224
modules/editor/tpl/js/uploader.js Executable file
View file

@ -0,0 +1,224 @@
/**
* @author zero (zero@nzeo.com)
* @version 0.1
* @brief 파일 업로드 관련
**/
var uploading_file = false;
var uploaded_files = new Array();
// 업로드를 하기 위한 준비 시작
function editor_upload_init(upload_target_srl) {
xAddEventListener(window,'load',function() {editor_upload_form_set(upload_target_srl);} );
}
// upload_target_srl에 해당하는 form의 action을 iframe으로 변경
function editor_upload_form_set(upload_target_srl) {
// 업로드용 iframe을 생성
if(!xGetElementById('tmp_upload_iframe')) {
if(xIE4Up) {
window.document.body.insertAdjacentHTML("afterEnd", "<iframe name='tmp_upload_iframe' style='display:none;width:1px;height:1px;position:absolute;top:-10px;left:-10px'></iframe>");
} else {
var obj_iframe = xCreateElement('IFRAME');
obj_iframe.name = obj_iframe.id = 'tmp_upload_iframe';
obj_iframe.style.display = 'none';
obj_iframe.style.width = '1px';
obj_iframe.style.height = '1px';
obj_iframe.style.position = 'absolute';
obj_iframe.style.top = '-10px';
obj_iframe.style.left = '-10px';
window.document.body.appendChild(obj_iframe);
}
}
// form의 action 을 변경
var field_obj = xGetElementById("uploaded_file_list_"+upload_target_srl);
if(!field_obj) return;
var fo_obj = field_obj.parentNode;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
fo_obj.target = 'tmp_upload_iframe';
// upload_target_srl에 해당하는 첨부파일 목록을 로드
var module = "";
if(fo_obj["module"]) module = fo_obj.module.value;
var mid = "";
if(fo_obj["mid"]) mid = fo_obj.mid.value;
var url = "./?act=procDeleteFile&upload_target_srl="+upload_target_srl;
if(module) url+="&module="+module;
if(mid) url+="&mid="+mid;
// iframe에 url을 보내버림
var iframe_obj = xGetElementById('tmp_upload_iframe');
if(!iframe_obj) return;
iframe_obj.contentWindow.document.location.href=url;
}
// 파일 업로드
function editor_file_upload(field_obj, upload_target_srl) {
if(uploading_file) return;
var fo_obj = field_obj.parentNode;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
uploading_file = true;
fo_obj.submit();
uploading_file = false;
var sel_obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
var str = 'wait for uploading...';
var opt_obj = new Option(str, '', true, true);
sel_obj.options[sel_obj.options.length] = opt_obj;
}
// 업로드된 파일 목록을 삭제
function editor_upload_clear_list(upload_target_srl) {
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
while(obj.options.length) {
obj.remove(0);
}
var preview_obj = xGetElementById('uploaded_file_preview_box_'+upload_target_srl);
xInnerHtml(preview_obj,'')
}
// 업로드된 파일 정보를 목록에 추가
function editor_insert_uploaded_file(upload_target_srl, file_srl, filename, file_size, disp_file_size, uploaded_filename, sid) {
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
var string = filename+' ('+disp_file_size+')';
var opt_obj = new Option(string, file_srl, true, true);
obj.options[obj.options.length] = opt_obj;
var file_obj = {file_srl:file_srl, filename:filename, file_size:file_size, uploaded_filename:uploaded_filename, sid:sid}
uploaded_files[file_srl] = file_obj;
editor_preview(obj, upload_target_srl);
}
// 파일 목록창에서 클릭 되었을 경우 미리 보기
function editor_preview(sel_obj, upload_target_srl) {
if(sel_obj.options.length<1) return;
var file_srl = sel_obj.options[sel_obj.selectedIndex].value;
var obj = uploaded_files[file_srl];
if(typeof(obj)=='undefined'||!obj) return;
var uploaded_filename = obj.uploaded_filename;
var preview_obj = xGetElementById('uploaded_file_preview_box_'+upload_target_srl);
if(!uploaded_filename) {
xInnerHtml(preview_obj, '');
return;
}
var html = "";
// 플래쉬 동영상의 경우
if(/\.flv$/i.test(uploaded_filename)) {
html = "<EMBED src=\""+editor_path+"component/flvplayer/flvplayer.swf?autoStart=true&file="+uploaded_filename+"\" width=\"120\" height=\"120\" type=\"application/x-shockwave-flash\"></EMBED>";
// 플래쉬 파일의 경우
} else if(/\.swf$/i.test(uploaded_filename)) {
html = "<EMBED src=\""+uploaded_filename+"\" width=\"120\" height=\"120\" type=\"application/x-shockwave-flash\"></EMBED>";
// wmv, avi, mpg, mpeg등의 동영상 파일의 경우
} else if(/\.(wmv|avi|mpg|mpeg|asx|asf|mp3)$/i.test(uploaded_filename)) {
html = "<EMBED src=\""+uploaded_filename+"\" width=\"120\" height=\"120\" autostart=\"true\" Showcontrols=\"0\"></EMBED>";
// 이미지 파일의 경우
} else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
html = "<img src=\""+uploaded_filename+"\" border=\"0\" width=\"120\" height=\"120\" />";
}
xInnerHtml(preview_obj, html);
}
// 업로드된 파일 삭제
function editor_remove_file(upload_target_srl) {
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
if(obj.options.length<1) return;
var file_srl = obj.options[obj.selectedIndex].value;
if(!file_srl) return;
// 삭제하려는 파일의 정보를 챙김;;
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?mid="+mid+"&act=procDeleteFile&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl;
// iframe에 url을 보내버림
var iframe_obj = xGetElementById('tmp_upload_iframe');
if(!iframe_obj) return;
iframe_obj.contentWindow.document.location.href=url;
}
// 업로드 목록의 선택된 파일을 내용에 추가
function editor_insert_file(upload_target_srl, align) {
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
if(obj.options.length<1) return;
var file_srl = obj.options[obj.selectedIndex].value;
if(!file_srl) return;
var file_obj = uploaded_files[file_srl];
var filename = file_obj.filename;
var sid = file_obj.sid;
var uploaded_filename = file_obj.uploaded_filename;
editorPrevSrl = upload_target_srl;
// 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..)
if(uploaded_filename && typeof(align)!='undefined') {
var type = "";
// 이미지 파일의 경우
if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
editorFocus(editorPrevSrl);
var html = "<img src=\""+uploaded_filename+"\" border=\"0\" alt=\""+filename+"\" ";
if(typeof(align)!='undefined'&&align) html += " align=\""+align+"\"";
html += " />"
var obj = editorGetIFrame(editorPrevSrl);
editorReplaceHTML(obj, html);
// 이미지외의 경우는 대체 이미지를 넣음
} else {
// 플래쉬 동영상의 경우
if(/\.flv$/i.test(uploaded_filename)) {
type = "flv";
uploaded_filename = editor_path+"component/flvplayer/flvplayer.swf?autoStart=true&file="+uploaded_filename;
// 플래쉬 파일의 경우
} else if(/\.swf$/i.test(uploaded_filename)) {
type = "swf";
// wmv, avi, mpg, mpeg등의 동영상 파일의 경우
} else if(/\.(wmv|avi|mpg|mpeg)$/i.test(uploaded_filename)) {
type = "multimedia";
}
var alt = "align="+align+"|@|src="+uploaded_filename+"|@|type="+type;
var html = "<img src=\""+editor_path+"images/blank.gif\" style=\"width:400px;height:300px;\" alt=\""+alt+"\" class=\"editor_multimedia\"/>";
var iframe_obj = editorGetIFrame(editorPrevSrl);
editorReplaceHTML(iframe_obj, html);
}
// binary파일의 경우 다운로드 링크를 추가
} else {
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?mid="+mid+"&amp;act=procDownload&amp;upload_target_srl="+upload_target_srl+"&amp;file_srl="+file_srl+"&amp;sid="+sid;
var x = (screen.availWidth - 400)/2;
var y = (screen.availHeight - 220)/2;
winopen(editor_path+"popup/add_url.php?title="+escape(filename)+"&url="+escape(url),"_editorPopup","top="+y+",left="+x+",width=400,height=220,resizable=no,toolbars=no,scrollbars=no");
}
}
/**
* 글을 쓰다가 페이지 이동시 첨부파일에 대한 정리
**/
function editorRemoveAttachFiles(mid, upload_target_srl) {
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
if(obj.options.length<1) return;
var params = new Array();
params['upload_target_srl'] = upload_target_srl;
exec_xml(mid, 'procClearFile', params, null, null, null);
}

View file

@ -0,0 +1,60 @@
<?php
/**
* @file : editor/lang/ko.lang.php
* @author : zero <zero@nzeo.com>
* @desc : 한국어 언어팩 (기본적인 내용만 수록)
**/
$lang->edit->fontname = '폰트';
$lang->edit->fontsize = '크기';
$lang->edit->use_paragraph = '문단기능';
$lang->edit->fontlist = array(
"굴림",
"돋움",
"바탕",
"궁서",
"times",
"Courier",
"Tahoma",
"Arial",
);
$lang->edit->image_url = '이미지 경로';
$lang->edit->multimedia_url = '멀티미디어 경로';
$lang->edit->multimedia_width = '가로크기';
$lang->edit->multimedia_height = '세로크기';
$lang->edit->submit = '확인';
$lang->edit->help_fontcolor = "글자의 색상을 지정합니다";
$lang->edit->help_fontbgcolor = "글자의 배경색상을 지정합니다";
$lang->edit->help_bold = "글자를 진하게 합니다";
$lang->edit->help_italic = "글자를 기울이게 합니다";
$lang->edit->help_underline = "밑줄을 긋습니다";
$lang->edit->help_strike = "취소선을 긋습니다";
$lang->edit->help_add_url= "link를 만듭니다";
$lang->edit->help_add_image = "이미지를 추가합니다";
$lang->edit->help_add_multimedia = "동영상/플래쉬등을 추가합니다";
$lang->edit->help_add_emoticon = "이모티콘을 추가합니다";
$lang->edit->help_add_quotation = "글박스를 만들거나 글숨김 기능을 추가합니다";
$lang->edit->help_add_html = "html 코드를 직접 입력합니다";
$lang->edit->help_add_html = "html 코드를 직접 입력합니다";
$lang->edit->help_align_left = "왼쪽 정렬을 합니다";
$lang->edit->help_align_center = "가운데 정렬을 합니다";
$lang->edit->help_align_right = "오른쪽 정렬을 합니다";
$lang->edit->help_add_indent = "들여쓰기를 합니다";
$lang->edit->help_remove_indent = "들여쓰기를 제거합니다";
$lang->edit->help_use_paragrapth = "정렬, 들여쓰기등의 문단 꾸미기 기능을 사용합니다.\n문단구분자로 P태그가 적용됩니다.\nShift+엔터를 이용하시면
BR태그가 적용됩니다.";
$lang->edit->upload = '첨부';
$lang->edit->link_selected = '다운로드 링크 추가';
$lang->edit->delete_selected = '선택파일 삭제';
$lang->edit->icon_align_article = '한 문단을 차지';
$lang->edit->icon_align_left = '글의 왼쪽으로';
$lang->edit->icon_align_middle = '가운데 정렬';
$lang->edit->icon_align_right = '글의 우측으로';
?>

View file

@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Emoticon</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
function editorPrintEmoticon() {
var html = '';
for(var i=1;i<=40;i++) {
var str = i;
if(i<10) str = '0'+i;
html += "<img src=\"./emoticon/msn0"+str+".gif\" onFocus=\"this.blur()\" style=\"margin:2px;width:19px;height:19px;cursor:pointer;border:1px solid;border-color:#CCCCCC;\" onMouseOver=\"this.style.borderColor='#ffffff'\" onMouseOut=\"this.style.borderColor='#CCCCCC'\" onClick=\"insertImage(this)\" />";
if(i%8==0) html += "<br />";
}
document.write(html);
}
function insertImage(obj) {
if(typeof(opener)=='undefined') return;
opener.editorInsertEmoticon(obj);
opener.editorFocus(opener.editorPrevSrl);
self.close();
}
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<script type="text/javascript">
editorPrintEmoticon();
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Html</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
function setText() {
if(typeof(opener)=='undefined') return;
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
var fo_obj = xGetElementById('fo');
fo_obj.text.value = text;
self.focus();
}
function insertHtml() {
if(typeof(opener)=='undefined') return;
var fo_obj = xGetElementById('fo');
var text = fo_obj.text.value;
if(!text) return;
opener.editorInsertHTML(text);
opener.focus();
self.close();
}
xAddEventListener(window, 'load', setText);
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form action='./' method='post' id='fo' onSubmit="return false" style="display:inline">
<div class="editor_window">
<div><textarea name="text" id='editor' class="editor_textarea"></textarea></div>
<div><input type='button' id='manual_url_submit' class="editor_submit" value='insert' onClick='insertHtml()' /></div>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Image</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
function insertImage() {
if(typeof(opener)=='undefined') return;
var fo_obj = xGetElementById("fo");
var url = fo_obj.url.value;
var align = fo_obj.align.options[fo_obj.align.selectedIndex].value;
if(url) {
opener.editorInsertImage(url, align);
opener.editorFocus(opener.editorPrevSrl);
}
self.close();
}
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form action='./' method='post' id="fo" onSubmit="return false" style="display:inline">
<div id='zone_AddUrl' class="editor_window">
<table width="380" border="0" cellspacing="1" cellpadding="0">
<col width="50" />
<col width="*" />
<tr>
<td class="editor_field">url</td>
<td><input type='text' name='url' class="editor_input" value='<?=$_GET['file_url']?>'/></td>
</tr>
<tr>
<td class="editor_field">type</td>
<td>
<select name='align'>
<option value=''>normal</option>
<option value='left'>left</option>
<option value='right'>right</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" height="40">
<input type='button' class="editor_submit" value='Insert' onClick='insertImage()' />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Multimedia</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
function insertMultimedia() {
if(typeof(opener)=='undefined') return;
var fo_obj = xGetElementById("fo_multimedia");
var url = fo_obj.url.value;
var width = fo_obj.width.value;
var height = fo_obj.height.value;
if(!width) width = 540;
if(!height) height = 400;
if(url) opener.emoticonInsertMultimedia(url, width, height);
opener.focus();
self.close();
}
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form id="fo_multimedia" action='./' method='post' onSubmit="return false" style="display:inline">
<div id='zone_AddUrl' class="editor_window">
<table width="400" border="0" cellspacing="1" cellpadding="0">
<col width="50" />
<col width="*" />
<tr>
<td class="editor_field">url</td>
<td><input type='text' name='url' class="editor_input" value=''/></td>
</tr>
<tr>
<td class="editor_field">width</td>
<td><input type='text' name='width' style="width:100px" class="editor_input" value='540'/></td>
</tr>
<tr>
<td class="editor_field">height</td>
<td><input type='text' name='height' style="width:100px" class="editor_input" value='400'/></td>
</tr>
<tr>
<td colspan="2"><input type='button' class="editor_submit" value='Insert' onClick='insertMultimedia()' /></td>
</tr>
</table>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,218 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Quotation</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
var color_list = new Array('000000','993300','333300','003300','003366','000080','333399','333333','800000','FF6600','808000','008000','008080','0000FF','666699','808080','FF0000','FF9900','99CC00','339966','33CCCC','3366FF','800080','969696','FF00FF','FFCC00','FFFF00','00FF00','00FFFF','00CCFF','993366','c0c0c0','FF99CC','FFCC99','FFFF99','CCFFCC','CCFFFF','99CCFF','CC99FF','FFFFFF');
function setText() {
if(typeof(opener)=='undefined') return;
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
var fo_obj = xGetElementById('fo');
fo_obj.text.value = text;
self.focus();
}
function change_type(obj) {
xGetElementById('quotation').style.display = 'none';
xGetElementById('htmlcode').style.display = 'none';
xGetElementById('phpcode').style.display = 'none';
xGetElementById('fold').style.display = 'none';
var editor_obj = xGetElementById('editor');
var val = obj.value;
xGetElementById(val).style.display = 'block';
switch(val) {
case 'quotation' :
xHeight(editor_obj,240);
break;
case 'htmlcode' :
xHeight(editor_obj,240);
break;
case 'phpcode' :
xHeight(editor_obj,240);
break;
case 'fold' :
xHeight(editor_obj,150);
break;
}
}
function change_color(obj) {
var code = obj.options[obj.selectedIndex].value;
obj.style.backgroundColor = "#"+code;
}
function write_color_list(field_name) {
var idx = '';
switch(field_name) {
case 'bgcolor' :
idx = color_list.length-1;
break;
case 'bordercolor' :
idx = 35;
break;
}
var html = "<select name='"+field_name+"' id='"+field_name+"' onChange='change_color(this);' style='width:40px;'>";
for(var i=0;i<color_list.length;i++) {
html += "<option value='"+color_list[i]+"' ";
if(i == idx) html += " selected ";
html += "style='background-color:#"+color_list[i]+"'></option>";
}
html += "</select>";
document.write(html);
}
function getSelectValue(obj) {
return obj.options[obj.selectedIndex].value;
}
function insertQuotation() {
if(typeof(opener)=='undefined') return;
var fo_obj = xGetElementById('fo');
var bgcolor = getSelectValue(fo_obj.bgcolor);
var bordercolor = getSelectValue(fo_obj.bordercolor);
var bordertype = 'background-color:#'+bgcolor+';';
switch(getSelectValue(fo_obj.bordertype)) {
case 'solid' :
bordertype += "border:1px solid #"+bordercolor+";";
break;
case 'dotted' :
bordertype += "border:1px dotted #"+bordercolor+";";
break;
case 'none' :
bordertype += "border:0px;";
break;
}
var bordercolor = getSelectValue(fo_obj.bordercolor);
var text = fo_obj.text.value;
var html = '';
if(!text) return;
if(xGetElementById('type_fold').checked) {
var opentext = fo_obj.opentext.value;
if(!opentext) opentext = 'more...';
var closetext = fo_obj.closetext.value;
if(!closetext) closetext = 'close';
var link_type = fo_obj.link_type.options[fo_obj.link_type.selectedIndex].value;
if(fo_obj.bold.checked) link_type = 'bold '+link_type;
var id = Math.round(Math.random()*1000000);
html = '<div id="_folder_open_'+id+'" class="folder_opener"><a href="#" onClick="svc_folder_open(\''+id+'\');return false;" class="'+link_type+'" style="text-decoration:none;">'+opentext+'</a></div>';
html += '<div id="_folder_close_'+id+'" class="folder_closer"><a href="#" onClick="svc_folder_close(\''+id+'\');return false;" class="'+link_type+'" style="text-decoration:none;">'+closetext+'</a></div>';
html += '<div id="_folder_'+id+'" class="folder_area" style="padding:10px; '+bordertype+'">'+text+'</div>';
html = "<div>"+html+"</div>";
} else {
html = '<div style="padding:10px; '+bordertype+'">'+text+'</div>';
}
opener.editorInsertQuotation(html);
opener.focus();
self.close();
}
xAddEventListener(window, 'load', setText);
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form action='./' method='post' id='fo' onSubmit="return false" style="display:inline">
<div id='zone_Quotation' class="editor_window">
<div class="quotation_box">
<input type="radio" id="type_quotation" name="quotation_type" value="quotation" checked onClick="change_type(this)" /> quotation
<input type="radio" id="type_fold" name="quotation_type" value="fold" onClick="change_type(this)" /> fold
</div>
<div class="quotation_type">
<table border="0" width="100%">
<col width="100" />
<col width="*" />
<tr>
<td class="editor_field">bg color</td>
<td class="editor_area"><script type="text/javascript">write_color_list("bgcolor");</script></td>
</tr>
<tr>
<td class="editor_field">border type</td>
<td class="editor_area">
<select name="bordertype">
<option value="solid">solid</option>
<option value="dotted">dotted</option>
<option value="none">none</option>
</select>
</td>
</tr>
<tr>
<td class="editor_field">border color</td>
<td class="editor_area"><script type="text/javascript">write_color_list("bordercolor");</script></td>
</tr>
</table>
</div>
<div class="quotation_type" id="quotation">
</div>
<div class="quotation_type" id="htmlcode" style="display:none"></div>
<div class="quotation_type" id="phpcode" style="display:none"></div>
<div class="quotation_type" id="fold" style="display:none">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<col width="100" />
<col width="*" />
<tr>
<td class="editor_field">open text</td>
<td><input type='text' name='opentext' class="editor_input" style="width:120px;" value='more...'/></td>
</tr>
<tr>
<td class="editor_field">close text</td>
<td><input type='text' name='closetext' class="editor_input" style="width:120px;" value='close' /></td>
</tr>
<tr>
<td class="editor_field">bold</td>
<td><input type='checkbox' name='bold' value='Y' /></td>
</tr>
<tr>
<td class="editor_field">type</td>
<td class="editor_area">
<select name='link_type'>
<option value=''>default</option>
<option value='editor_blue_text'>blue</option>
<option value='editor_red_text'>red</option>
<option value='editor_green_text'>green</option>
<option value='editor_yellow_text'>yellow</option>
</select>
</td>
</tr>
</table>
</div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><textarea name="text" id='editor' class="editor_textarea" style="width:100%;height:240px;"><?=$_REQUEST['title']?></textarea></td>
</tr>
<tr>
<td>
<input type='button' id='manual_url_submit' class="editor_submit" value='Insert' onClick='insertQuotation()' />
</td>
</tr>
</table>
</div>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Url</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type="text/javascript">
function setText() {
if(typeof(opener)=="undefined") return;
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
var fo_obj = xGetElementById("fo");
if(fo_obj.text.value) return;
fo_obj.text.value = text;
self.focus();
}
function insertUrl() {
if(typeof(opener)=="undefined") return;
var fo_obj = xGetElementById("fo");
var text = fo_obj.text.value;
var url = fo_obj.url.value;
var link_type = fo_obj.link_type.options[fo_obj.link_type.selectedIndex].value;
if(fo_obj.bold.checked) link_type = "bold "+link_type;
if(text && url) opener.editorInsertUrl(text, url, link_type);
opener.focus();
self.close();
}
xAddEventListener(window, "load", setText);
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form action="./" method="post" id="fo" onSubmit="return false" style="display:inline">
<div id="zone_AddUrl" class="editor_window">
<table width="380" border="0" cellspacing="1" cellpadding="0">
<col width="50" />
<col width="*" />
<tr>
<td class="editor_field">text</td>
<td><textarea name="text" class="editor_small_textarea"><?=$_REQUEST["title"]?></textarea></td>
</tr>
<tr>
<td class="editor_field">url</td>
<td><input type="text" name="url" class="editor_input" value="<?=$_REQUEST["url"]?>"/></td>
</tr>
<tr>
<td class="editor_field">bold</td>
<td><input type="checkbox" name="bold" value="Y" /></td>
</tr>
<tr>
<td class="editor_field">type</td>
<td>
<select name="link_type">
<option value="">default</option>
<option value="editor_blue_text">blue</option>
<option value="editor_red_text">red</option>
<option value="editor_green_text">green</option>
<option value="editor_yellow_text">yellow</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" id="manual_url_submit" class="editor_submit" value="Insert" onClick="insertUrl()" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>change Color</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type='text/javascript'>
var color_list = new Array('000000','993300','333300','003300','003366','000080','333399','333333','800000','FF6600','808000','008000','008080','0000FF','666699','808080','FF0000','FF9900','99CC00','339966','33CCCC','3366FF','800080','969696','FF00FF','FFCC00','FFFF00','00FF00','00FFFF','00CCFF','993366','c0c0c0','FF99CC','FFCC99','FFFF99','CCFFCC','CCFFFF','99CCFF','CC99FF','FFFFFF');
function printColorBox() {
var html = '';
for(var i=0;i<color_list.length;i++) {
html += "<div style=\"float:left;background-color:#"+color_list[i]+"\"><img src=\"..\/images\/blank.gif\" class=\"color_icon\" onmouseover=\"this.className='color_icon_over'\" onmouseout=\"this.className='color_icon'\" onclick=\"setColor('"+color_list[i]+"')\" \/><\/div>";
}
document.write(html);
}
function setColor(color) {
var mode = "<?=$_REQUEST['mode']?>";
opener.editorFocus(opener.editorPrevSrl);
if(mode == "ForeColor") {
opener.editorSetForeColor("#"+color);
} else {
opener.editorSetBackColor("#"+color);
}
opener.editorFocus(opener.editorPrevSrl);
self.close();
}
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<script type="text/javascript">
printColorBox();
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB