mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-25 14:19:58 +09:00
code_highlighter(edit component) 업데이트
- dp.SyntaxHighlighter 1.4에서 1.5.1로 업데이트 (통째로 덮어 씌움..) - Abap 언어 추가. - 접기/줄 번호 감추기/도구바 감추기 설정 추가. git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3104 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
12f685e116
commit
f490cad881
21 changed files with 1090 additions and 578 deletions
|
|
@ -29,6 +29,7 @@
|
|||
<option value="Python">Python</option>
|
||||
<option value="Ruby">Ruby</option>
|
||||
<option value="Sql">SQL</option>
|
||||
<option value="Abap">Abap</option>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -5,25 +5,34 @@
|
|||
var selected_node = null;
|
||||
function getCode() {
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||
if(typeof(opener)=="undefined") return;
|
||||
if(typeof(opener)=='undefined') return;
|
||||
|
||||
var node = opener.editorPrevNode;
|
||||
if(!node || node.nodeName != "DIV") return;
|
||||
if(!node || node.nodeName != 'DIV') return;
|
||||
|
||||
selected_node = node;
|
||||
|
||||
var code_type = node.getAttribute("code_type");
|
||||
var code_type = node.getAttribute('code_type');
|
||||
var collapse = node.getAttribute('collapse');
|
||||
var nogutter = node.getAttribute('nogutter');
|
||||
var nocontrols = node.getAttribute('nocontrols');
|
||||
|
||||
xGetElementById("code_type").value = code_type;
|
||||
xGetElementById('code_type').value = code_type;
|
||||
if(collapse == 'Y') xGetElementById('collapse').checked = true;
|
||||
if(nogutter == 'Y') xGetElementById('nogutter').checked = true;
|
||||
if(nocontrols == 'Y') xGetElementById('nocontrols').checked = true;
|
||||
}
|
||||
|
||||
/* 추가 버튼 클릭시 부모창의 위지윅 에디터에 인용구 추가 */
|
||||
function insertCode() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
if(typeof(opener)=='undefined') return;
|
||||
|
||||
var code_type = xGetElementById("code_type").value;
|
||||
var code_type = xGetElementById('code_type').value;
|
||||
var collapse = xGetElementById('collapse').checked;
|
||||
var nogutter = xGetElementById("nogutter").checked;
|
||||
var nocontrols = xGetElementById("nocontrols").checked;
|
||||
|
||||
var content = "";
|
||||
var content = '';
|
||||
if(selected_node) content = xInnerHtml(selected_node);
|
||||
else content = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
|
||||
|
|
@ -31,11 +40,26 @@ function insertCode() {
|
|||
|
||||
if(!content) content = " ";
|
||||
|
||||
var text = "\n<div editor_component=\"code_highlighter\" code_type="+code_type+" style=\""+style+"\">"+content+"</div>\n<br />";
|
||||
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);
|
||||
selected_node.setAttribute('code_type', code_type);
|
||||
if(collapse == true) {
|
||||
selected_node.setAttribute('collapse', 'Y');
|
||||
} else {
|
||||
selected_node.setAttribute('collapse', 'N');
|
||||
}
|
||||
if(nogutter == true) {
|
||||
selected_node.setAttribute('nogutter', 'Y');
|
||||
} else {
|
||||
selected_node.setAttribute('nogutter', 'N');
|
||||
}
|
||||
if(nocontrols == true && collapse == false) {
|
||||
selected_node.setAttribute('nocontrols', 'Y');
|
||||
} else {
|
||||
selected_node.setAttribute('nocontrols', 'N');
|
||||
}
|
||||
selected_node.setAttribute('style', style);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
} else {
|
||||
|
|
@ -49,4 +73,4 @@ function insertCode() {
|
|||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getCode);
|
||||
xAddEventListener(window, 'load', getCode);
|
||||
Loading…
Add table
Add a link
Reference in a new issue