mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@509 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b0dbe0efa7
commit
bceeda56f3
7 changed files with 28 additions and 28 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<!--%import("urllink.js")-->
|
||||
<!--%import("urllink.css")-->
|
||||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
<div class="urllink_title">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'urllink.html';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
$tpl_path = $this->module_path.'tpl';
|
||||
$tpl_file = 'editor.html';
|
||||
|
||||
// editor_path를 지정
|
||||
Context::set('editor_path', $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<!-- 에디터 활성화 -->
|
||||
<script type="text/javascript">
|
||||
var editor_path = "./editor/";
|
||||
var editor_path = "{$editor_path}";
|
||||
editorInit("{$upload_target_srl}");
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -48,22 +48,14 @@ function editorStart(upload_target_srl) {
|
|||
|
||||
// 기본 내용 작성
|
||||
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>";
|
||||
//'<!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"/>'+
|
||||
'<link rel="stylesheet" href="./common/css/common.css" type="text/css" />'+
|
||||
'<link rel="stylesheet" href="'+editor_path+'/css/editor.css" type="text/css" />'+
|
||||
'</head><body style="background-color:#FFFFFF;font-family:'+default_font+';font-size:9pt;">'+
|
||||
content+
|
||||
'</body></html>'+
|
||||
'';
|
||||
|
||||
contentDocument.designMode = 'on';
|
||||
contentDocument.open("text/html","replace");
|
||||
|
|
@ -90,6 +82,7 @@ function editorStart(upload_target_srl) {
|
|||
|
||||
// 에디터의 내용을 지속적으로 fo_obj.content.value에 입력
|
||||
editorSyncContent(fo_obj.content, upload_target_srl);
|
||||
editorFocus(upload_target_srl);
|
||||
}
|
||||
|
||||
var _editorSyncList = new Array();
|
||||
|
|
@ -143,16 +136,21 @@ function editorGetSelectedHtml(upload_target_srl) {
|
|||
|
||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||
function editorReplaceHTML(iframe_obj, html) {
|
||||
iframe_obj.contentWindow.focus();
|
||||
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
range.pasteHTML(html);
|
||||
iframe_obj.contentWindow.document.selection.createRange().pasteHTML(html);
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
range.deleteContents();
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
if(iframe_obj.contentWindow.getSelection().focusNode.tagName == "HTML") {
|
||||
var range = iframe_obj.contentDocument.createRange();
|
||||
range.setStart(iframe_obj.contentDocument.body,0);
|
||||
range.setEnd(iframe_obj.contentDocument.body,0);
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
range.deleteContents();
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
}
|
||||
}
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
// 입력 키에 대한 이벤트 체크
|
||||
|
|
@ -272,7 +270,6 @@ function editorFocus(upload_target_srl) {
|
|||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
|
||||
// 편집 기능 실행
|
||||
function editorDo(name, value, target) {
|
||||
if(typeof(target)=='object') _editorDoObject(name, value, target);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue