mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 07:09:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@538 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d59f2b8f9
commit
6f4d1bd289
6 changed files with 0 additions and 0 deletions
BIN
modules/editor/components/url_link/icon.gif
Normal file
BIN
modules/editor/components/url_link/icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
21
modules/editor/components/url_link/lang/ko.lang.php
Normal file
21
modules/editor/components/url_link/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/urllink/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈 > urllink 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->urllink_title = "제목";
|
||||
$lang->urllink_url = "URL";
|
||||
$lang->urllink_open_window = "새창열기";
|
||||
$lang->urllink_bold = " 글자 굵게";
|
||||
|
||||
$lang->urllink_color = "링크 색상 ";
|
||||
$lang->urllink_color_blue = "파란색";
|
||||
$lang->urllink_color_red = "붉은색";
|
||||
$lang->urllink_color_yellow = "노란색";
|
||||
$lang->urllink_color_green = "녹색";
|
||||
|
||||
$lang->about_url_link_open_window = "선택하시면 링크 선택시 새창으로 열립니다";
|
||||
$lang->about_url_link_bold = "선택하시면 링크의 글자가 굵게 표시됩니다";
|
||||
?>
|
||||
52
modules/editor/components/url_link/tpl/popup.css
Normal file
52
modules/editor/components/url_link/tpl/popup.css
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
.editor_window {
|
||||
width:400px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.header {
|
||||
float:left;
|
||||
width:60px;
|
||||
clear:left;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
.body {
|
||||
float:left;
|
||||
width:290px;
|
||||
text-align:left;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.editor_textarea {
|
||||
width:280px;
|
||||
height:50px;
|
||||
border:1px solid #AAAAAA;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.editor_input {
|
||||
width:280px;
|
||||
border:1px solid #AAAAAA;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.editor_button_area {
|
||||
clear:both;
|
||||
width:100%;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding-top:5px;
|
||||
height:30px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
margin-top:4px;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
}
|
||||
43
modules/editor/components/url_link/tpl/popup.html
Normal file
43
modules/editor/components/url_link/tpl/popup.html
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
<div class="editor_window">
|
||||
<div class="header">{$lang->urllink_title}</div>
|
||||
<div class="body"><textarea name="text" class="editor_textarea"></textarea></div>
|
||||
|
||||
<div class="header">{$lang->urllink_url}</div>
|
||||
<div class="body"><input type="text" name="url" class="editor_input" value=""/></div>
|
||||
|
||||
<div class="header">{$lang->urllink_open_window}</div>
|
||||
<div class="body"><input type="checkbox" name="open_window" value="Y" id="editor_open_window" /> <label for="editor_open_window">{$lang->about_url_link_open_window}</label></div>
|
||||
|
||||
<div class="header">{$lang->urllink_bold}</div>
|
||||
<div class="body"><input type="checkbox" name="bold" value="Y" id="editor_bold" /> <label for="editor_bold">{$lang->about_url_link_bold}</label></div>
|
||||
|
||||
<div class="header">{$lang->urllink_color}</div>
|
||||
<div class="body">
|
||||
<span>
|
||||
<input type="radio" name="color" value="blue" id="color_blue" />
|
||||
<label for="color_blue"><a href="#" class="editor_blue_text">{$lang->urllink_color_blue}</a></label>
|
||||
</span>
|
||||
<span>
|
||||
<input type="radio" name="color" value="red" id="color_red" />
|
||||
<label for="color_red"><a href="#" class="editor_red_text">{$lang->urllink_color_red}</a></label>
|
||||
</span>
|
||||
<span>
|
||||
<input type="radio" name="color" value="yellow" id="color_yellow" />
|
||||
<label for="color_yellow"><a href="#" class="editor_yellow_text">{$lang->urllink_color_yellow}</a></label>
|
||||
</span>
|
||||
<span>
|
||||
<input type="radio" name="color" value="green" id="color_green" />
|
||||
<label for="color_green"><a href="#" class="editor_green_text">{$lang->urllink_color_green}</a></label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_insert}" onclick="setText()" />
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close()" />
|
||||
</div>
|
||||
</form>
|
||||
63
modules/editor/components/url_link/tpl/popup.js
Normal file
63
modules/editor/components/url_link/tpl/popup.js
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
function getText() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
var fo_obj = xGetElementById("fo_component");
|
||||
if(fo_obj.text.value) return;
|
||||
fo_obj.text.value = text;
|
||||
self.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 부모창의 위지윅에디터에 데이터를 삽입
|
||||
**/
|
||||
function setText() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var fo_obj = xGetElementById("fo_component");
|
||||
|
||||
var text = fo_obj.text.value;
|
||||
var url = fo_obj.url.value;
|
||||
var open_window = false;
|
||||
var bold = false;
|
||||
var link_class = "";
|
||||
|
||||
if(!text) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
if(fo_obj.open_window.checked) open_window = true;
|
||||
if(fo_obj.bold.checked) bold= true;
|
||||
if(xGetElementById("color_blue").checked) link_class = "editor_blue_text";
|
||||
else if(xGetElementById("color_red").checked) link_class = "editor_red_text";
|
||||
else if(xGetElementById("color_yellow").checked) link_class = "editor_yellow_text";
|
||||
else if(xGetElementById("color_green").checked) link_class = "editor_green_text";
|
||||
|
||||
var link = "";
|
||||
if(open_window) {
|
||||
link = "<a href=\"#\" onclick=\"window.open('"+url+"');return false;\" ";
|
||||
} else {
|
||||
link = "<a href=\""+url+"\" ";
|
||||
}
|
||||
|
||||
if(bold || link_class) {
|
||||
var class_name = "";
|
||||
if(bold) class_name = "bold";
|
||||
if(link_class) class_name += " "+link_class;
|
||||
link += " class=\""+class_name+"\" ";
|
||||
}
|
||||
|
||||
link += ">"+text+"</a>";
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, link);
|
||||
|
||||
opener.focus();
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getText);
|
||||
51
modules/editor/components/url_link/urllink.class.php
Normal file
51
modules/editor/components/url_link/urllink.class.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/**
|
||||
* @class urllink
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 에디터에서 url링크하는 기능 제공. 단순 팝업.
|
||||
**/
|
||||
|
||||
class urllink extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function urllink($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다.
|
||||
* execute의 경우 2가지 경우가 생긴다.
|
||||
* 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데
|
||||
* popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다
|
||||
**/
|
||||
function execute() {
|
||||
|
||||
$url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=urllink', $this->upload_target_srl);
|
||||
|
||||
$this->add('tpl', '');
|
||||
$this->add('open_window', 'Y');
|
||||
$this->add('popup_url', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue