mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 06:39:56 +09:00
BNU님의 code highlighter 에디터 컴포넌트 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3079 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
15fad89c08
commit
0d9265990a
27 changed files with 945 additions and 0 deletions
BIN
modules/editor/components/code_highlighter/tpl/images/blank.gif
Executable file
BIN
modules/editor/components/code_highlighter/tpl/images/blank.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 43 B |
BIN
modules/editor/components/code_highlighter/tpl/images/border_dotted.gif
Executable file
BIN
modules/editor/components/code_highlighter/tpl/images/border_dotted.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 86 B |
BIN
modules/editor/components/code_highlighter/tpl/images/border_left_dotted.gif
Executable file
BIN
modules/editor/components/code_highlighter/tpl/images/border_left_dotted.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 79 B |
BIN
modules/editor/components/code_highlighter/tpl/images/border_left_solid.gif
Executable file
BIN
modules/editor/components/code_highlighter/tpl/images/border_left_solid.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 77 B |
BIN
modules/editor/components/code_highlighter/tpl/images/border_solid.gif
Executable file
BIN
modules/editor/components/code_highlighter/tpl/images/border_solid.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 89 B |
24
modules/editor/components/code_highlighter/tpl/popup.css
Executable file
24
modules/editor/components/code_highlighter/tpl/popup.css
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
@charset "utf-8";
|
||||
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
||||
|
||||
#folder_area { clear:left; }
|
||||
|
||||
.border_type { float:left; margin-right:1em; width:120px; }
|
||||
|
||||
img.color_icon { width:14px; height:14px; border:1px solid #FFFFFF; }
|
||||
|
||||
img.color_icon_over { width:14px; height:14px; border:1px solid #000000; cursor:pointer; }
|
||||
|
||||
img.border_preview_color { width:30px; height:16px; border:1px solid #EEEEEE; background-color:#88EE22; }
|
||||
|
||||
img.border_preview_none_color { width:30px; height:12px; border:1px solid #EEEEEE; background-color:#FFFFFF; }
|
||||
|
||||
img.bg_preview_color { width:30px; height:16px; border:1px solid #000000; background-color:#FFFFFF; }
|
||||
|
||||
.editor_color_box { clear:both; height:65px; width:400px; border:1px solid #DDDDDD; padding:2px; }
|
||||
|
||||
.editor_link_type { float:left; margin-right:.5em; vertical-align:middle; white-space:nowrap; }
|
||||
|
||||
.editor_color_input { clear:both; }
|
||||
|
||||
li { list-style:none; float:left; margin:5px 10px 0px 0;}
|
||||
46
modules/editor/components/code_highlighter/tpl/popup.html
Executable file
46
modules/editor/components/code_highlighter/tpl/popup.html
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="120" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->code_type}</th>
|
||||
<td>
|
||||
<ul class="buttonLeft nospace">
|
||||
<li>
|
||||
<select id="code_type" name="code_type">
|
||||
<option value="Php">PHP</option>
|
||||
<option value="Css">CSS</option>
|
||||
<option value="JScript">Javascript</option>
|
||||
<option value="Xml">XML</option>
|
||||
<option value="Cpp">C++</option>
|
||||
<option value="CSharp">C#</option>
|
||||
<option value="Vb">VB</option>
|
||||
<option value="Java">Java</option>
|
||||
<option value="Delphi">Delphi</option>
|
||||
<option value="Python">Python</option>
|
||||
<option value="Ruby">Ruby</option>
|
||||
<option value="Sql">SQL</option>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertCode()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
52
modules/editor/components/code_highlighter/tpl/popup.js
Executable file
52
modules/editor/components/code_highlighter/tpl/popup.js
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
var selected_node = null;
|
||||
function getCode() {
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var node = opener.editorPrevNode;
|
||||
if(!node || node.nodeName != "DIV") return;
|
||||
|
||||
selected_node = node;
|
||||
|
||||
var code_type = node.getAttribute("code_type");
|
||||
|
||||
xGetElementById("code_type").value = code_type;
|
||||
}
|
||||
|
||||
/* 추가 버튼 클릭시 부모창의 위지윅 에디터에 인용구 추가 */
|
||||
function insertCode() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var code_type = xGetElementById("code_type").value;
|
||||
|
||||
var content = "";
|
||||
if(selected_node) content = xInnerHtml(selected_node);
|
||||
else content = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
|
||||
var style = "border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;";
|
||||
|
||||
if(!content) content = " ";
|
||||
|
||||
var text = "\n<div editor_component=\"code_highlighter\" code_type="+code_type+" style=\""+style+"\">"+content+"</div>\n<br />";
|
||||
|
||||
if(selected_node) {
|
||||
selected_node.setAttribute("code_type", code_type);
|
||||
selected_node.setAttribute("style", style);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
} else {
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
}
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getCode);
|
||||
Loading…
Add table
Add a link
Reference in a new issue