mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@540 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5c8454f6ed
commit
318b5f1f56
5 changed files with 90 additions and 25 deletions
|
|
@ -21,25 +21,10 @@ a.bold {
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.editor_blue_text:link { color: #145ff9; text-decoration:none; border-bottom:2px solid #4a7fec;}
|
.editor_blue_text { color: #145ff9; text-decoration:none; border-bottom:2px solid #4a7fec;}
|
||||||
a.editor_blue_text:visited { color: #145ff9; text-decoration:none; border-bottom:2px solid #4a7fec;}
|
.editor_red_text { color: #f42126; text-decoration:none; border-bottom:2px solid #e54347; }
|
||||||
a.editor_blue_text:active { color: #145ff9; text-decoration:none; border-bottom:2px solid #4a7fec;}
|
.editor_yellow_text { color: #c9bd00; text-decoration:none; border-bottom:2px solid #ece460; }
|
||||||
a.editor_blue_text:hover { color: #145ff9; text-decoration:none; border-bottom:2px solid #4a7fec;}
|
.editor_green_text { color: #08830B; text-decoration:none; border-bottom:2px solid #08830B;}
|
||||||
|
|
||||||
a.editor_red_text:link { color: #f42126; text-decoration:none; border-bottom:2px solid #e54347; }
|
|
||||||
a.editor_red_text:visited { color: #f42126; text-decoration:none; border-bottom:2px solid #e54347;}
|
|
||||||
a.editor_red_text:active { color: #f42126; text-decoration:none; border-bottom:2px solid #e54347;}
|
|
||||||
a.editor_red_text:hover { color: #f42126; text-decoration:none; border-bottom:2px solid #e54347;}
|
|
||||||
|
|
||||||
a.editor_yellow_text:link { color: #c9bd00; text-decoration:none; border-bottom:2px solid #ece460; }
|
|
||||||
a.editor_yellow_text:visited { color: #c9bd00; text-decoration:none; border-bottom:2px solid #ece460;}
|
|
||||||
a.editor_yellow_text:active { color: #c9bd00; text-decoration:none; border-bottom:2px solid #ece460;}
|
|
||||||
a.editor_yellow_text:hover { color: #c9bd00; text-decoration:none; border-bottom:2px solid #ece460;}
|
|
||||||
|
|
||||||
a.editor_green_text:link { color: #08830B; text-decoration:none; border-bottom:2px solid #08830B;}
|
|
||||||
a.editor_green_text:visited { color: #08830B; text-decoration:none; border-bottom:2px solid #08830B;}
|
|
||||||
a.editor_green_text:active { color: #08830B; text-decoration:none; border-bottom:2px solid #08830B;}
|
|
||||||
a.editor_green_text:hover { color: #08830B; text-decoration:none; border-bottom:2px solid #08830B;}
|
|
||||||
|
|
||||||
.folder_opener { display: block; }
|
.folder_opener { display: block; }
|
||||||
.folder_closer { display: none; }
|
.folder_closer { display: none; }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
.editor_window {
|
.editor_window {
|
||||||
width:400px;
|
width:400px;
|
||||||
|
height:200px;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
clear:both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|
@ -37,12 +39,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor_button_area {
|
.editor_button_area {
|
||||||
clear:both;
|
|
||||||
width:100%;
|
|
||||||
text-align:center;
|
text-align:center;
|
||||||
background-color:#EEEEEE;
|
background-color:#EEEEEE;
|
||||||
padding-top:5px;
|
padding-top:5px;
|
||||||
height:30px;
|
height:30px;
|
||||||
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor_button {
|
.editor_button {
|
||||||
|
|
|
||||||
|
|
@ -19,25 +19,27 @@
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<span>
|
<span>
|
||||||
<input type="radio" name="color" value="blue" id="color_blue" />
|
<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>
|
<label for="color_blue" class="editor_blue_text">{$lang->urllink_color_blue}</label>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<input type="radio" name="color" value="red" id="color_red" />
|
<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>
|
<label for="color_red" class="editor_red_text">{$lang->urllink_color_red}</label>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<input type="radio" name="color" value="yellow" id="color_yellow" />
|
<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>
|
<label for="color_yellow" class="editor_yellow_text">{$lang->urllink_color_yellow}</label>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<input type="radio" name="color" value="green" id="color_green" />
|
<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>
|
<label for="color_green" class="editor_green_text">{$lang->urllink_color_green}</label>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="editor_button_area">
|
<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_insert}" onclick="setText()" />
|
||||||
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close()" />
|
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close()" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,66 @@
|
||||||
* 있으면 가져와서 원하는 곳에 삽입
|
* 있으면 가져와서 원하는 곳에 삽입
|
||||||
**/
|
**/
|
||||||
function getText() {
|
function getText() {
|
||||||
|
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||||
if(typeof(opener)=="undefined") return;
|
if(typeof(opener)=="undefined") return;
|
||||||
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||||
|
|
||||||
|
// 선택된 영역이 A태그인지 확인
|
||||||
|
if(text) {
|
||||||
|
var node = opener.editorGetSelectedNode(opener.editorPrevSrl);
|
||||||
|
if(node.nodeName == "A") {
|
||||||
|
var url = node.getAttribute("HREF");
|
||||||
|
|
||||||
|
var onclick_str = "";
|
||||||
|
if(xIE4Up) {
|
||||||
|
onclick_str = node.outerHTML;
|
||||||
|
} else {
|
||||||
|
if(node.getAttribute("onclick")) onclick_str = node.getAttribute("onclick");
|
||||||
|
}
|
||||||
|
|
||||||
|
var className = "";
|
||||||
|
if(typeof(node.className)) className = node.className;
|
||||||
|
else className = node.getAttribute("class");
|
||||||
|
var open_window = false;
|
||||||
|
|
||||||
|
if(onclick_str) {
|
||||||
|
open_window = true;
|
||||||
|
|
||||||
|
var s_s = "window.open('";
|
||||||
|
var p_s = onclick_str.indexOf(s_s);
|
||||||
|
url = onclick_str.substr(p_s+s_s.length);
|
||||||
|
|
||||||
|
var e_s = "')";
|
||||||
|
var p_e = url.indexOf(e_s);
|
||||||
|
url = url.substr(0, p_e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var bold = false;
|
||||||
|
var color = "";
|
||||||
|
|
||||||
|
if(className) {
|
||||||
|
if(className.indexOf("bold")>-1) bold = true;
|
||||||
|
|
||||||
|
if(className.indexOf("blue")>0) color = "color_blue";
|
||||||
|
else if(className.indexOf("red")>0) color = "color_red";
|
||||||
|
else if(className.indexOf("yellow")>0) color = "color_yellow";
|
||||||
|
else if(className.indexOf("green")>0) color = "color_green";
|
||||||
|
}
|
||||||
|
|
||||||
|
var fo_obj = xGetElementById("fo_component");
|
||||||
|
|
||||||
|
fo_obj.text.value = xInnerHtml(node);
|
||||||
|
fo_obj.url.value = url;
|
||||||
|
if(open_window) fo_obj.open_window.checked = true;
|
||||||
|
if(bold) fo_obj.bold.checked = true;
|
||||||
|
if(color) xGetElementById(color).checked = true;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 기본 설정
|
||||||
var fo_obj = xGetElementById("fo_component");
|
var fo_obj = xGetElementById("fo_component");
|
||||||
if(fo_obj.text.value) return;
|
if(fo_obj.text.value) return;
|
||||||
fo_obj.text.value = text;
|
fo_obj.text.value = text;
|
||||||
|
|
@ -30,6 +88,8 @@ function setText() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!url) url = "#";
|
||||||
|
|
||||||
if(fo_obj.open_window.checked) open_window = true;
|
if(fo_obj.open_window.checked) open_window = true;
|
||||||
if(fo_obj.bold.checked) bold= true;
|
if(fo_obj.bold.checked) bold= true;
|
||||||
if(xGetElementById("color_blue").checked) link_class = "editor_blue_text";
|
if(xGetElementById("color_blue").checked) link_class = "editor_blue_text";
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,23 @@ function editorGetSelectedHtml(upload_target_srl) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 에디터 내의 선택된 부분의 NODE를 return
|
||||||
|
function editorGetSelectedNode(upload_target_srl) {
|
||||||
|
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||||
|
if(xIE4Up) {
|
||||||
|
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||||
|
var div = xCreateElement('div');
|
||||||
|
xInnerHtml(div, range.htmlText);
|
||||||
|
var node = div.firstChild;
|
||||||
|
return node;
|
||||||
|
} else {
|
||||||
|
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||||
|
var node = xCreateElement('div');
|
||||||
|
node.appendChild(range.cloneContents());
|
||||||
|
return node.firstChild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||||
function editorReplaceHTML(iframe_obj, html) {
|
function editorReplaceHTML(iframe_obj, html) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue