mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 10:19:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@508 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
601849c669
commit
b0dbe0efa7
5 changed files with 50 additions and 59 deletions
|
|
@ -5,4 +5,6 @@
|
|||
* @brief 위지윅에디터(editor) 모듈 > urllink 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->urllink_title = "제목";
|
||||
$lang->urllink_url = "URL";
|
||||
?>
|
||||
|
|
|
|||
15
modules/editor/components/urllink/tpl/urllink.css
Normal file
15
modules/editor/components/urllink/tpl/urllink.css
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
.urllink_title {
|
||||
width:400px;
|
||||
}
|
||||
|
||||
.urllink_title textarea {
|
||||
width:300px;
|
||||
}
|
||||
|
||||
.urllink_url {
|
||||
width:400px;
|
||||
}
|
||||
|
||||
.urllink_url input {
|
||||
width:300px;
|
||||
}
|
||||
|
|
@ -1,41 +1,14 @@
|
|||
<!--%import("urllink.js")-->
|
||||
<!--%import("urllink.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<form action="./" method="get" id="fo" onSubmit="return false">
|
||||
|
||||
<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>
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
<div class="urllink_title">
|
||||
{$lang->urllink_title} : <textarea name="text"></textarea>
|
||||
</div>
|
||||
<div class="urllink_url">
|
||||
{$lang->urllink_url} : <input type="text" name="url" class="editor_input" value=""/>
|
||||
</div>
|
||||
<div>
|
||||
<input type="button" id="manual_url_submit" class="editor_submit" value="{$lang->cmd_insert}" onClick="setText()" />
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,35 @@
|
|||
function setText() {
|
||||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
function getText() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
var fo_obj = xGetElementById("fo");
|
||||
var fo_obj = xGetElementById("fo_component");
|
||||
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");
|
||||
/**
|
||||
* 부모창의 위지윅에디터에 데이터를 삽입
|
||||
**/
|
||||
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 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);
|
||||
|
||||
var link = text;
|
||||
if(url) link = "<a href=\""+url+"\" target=\"_blank\">"+text+"</a>";
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, link);
|
||||
|
||||
opener.focus();
|
||||
self.close();
|
||||
}
|
||||
xAddEventListener(window, "load", setText);
|
||||
|
||||
xAddEventListener(window, "load", getText);
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ function editorReplaceHTML(iframe_obj, html) {
|
|||
range.deleteContents();
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
}
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
// 입력 키에 대한 이벤트 체크
|
||||
|
|
@ -347,19 +348,6 @@ function editorDoInsertUrl(link, upload_target_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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue