mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
1. 에디터컴포넌트의 구현 방식을 변경하여 내용에 상관없이 잘 출력되도록 변경
(code highlighter 문제 해결) 2. 이모티콘 에디터컴포넌트의 팝업 내용이 IE에서 사라지는 문제 수정 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6297 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
56dbc7a996
commit
99e1e0d97b
4 changed files with 15 additions and 27 deletions
|
|
@ -1,9 +1,6 @@
|
||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
|
|
||||||
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
||||||
|
img.emoticon { margin:10px 10px 0 0; cursor:pointer; }
|
||||||
img.emoticon { margin:10px; cursor:pointer; }
|
.emoticonList { position:absolute; right:40px; top:4px;}
|
||||||
|
|
||||||
.emoticonList { position:absolute; top:9px; right:30px; }
|
|
||||||
*:first-child+html .emoticonList { top:9px; }
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,10 @@
|
||||||
<div class="emoticonList">
|
<div class="emoticonList">
|
||||||
<select name="list" onchange="getEmoticons(this.options[this.selectedIndex].value); return false;">
|
<select name="list" onchange="getEmoticons(this.options[this.selectedIndex].value); return false;">
|
||||||
<!--@foreach($emoticon_list as $key => $val)-->
|
<!--@foreach($emoticon_list as $key => $val)-->
|
||||||
<option value="{$val}">{$val}</option>
|
<option <!--@if($val=='msn')-->selected="select"<!--@end--> value="{$val}">{$val}</option>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="popBody">
|
<div id="popBody">
|
||||||
<!--@foreach($emoticons as $src)-->
|
|
||||||
<img src="images/{$src}" alt="{$src}" onclick="insertEmoticon(this); return false;" class="emoticon" />
|
|
||||||
<!--@end-->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -35,3 +35,5 @@ function completeGetEmoticons(ret_obj) {
|
||||||
setFixedPopupSize();
|
setFixedPopupSize();
|
||||||
setTimeout(setFixedPopupSize,1000);
|
setTimeout(setFixedPopupSize,1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jQuery(window).load(function() { getEmoticons('msn'); });
|
||||||
|
|
|
||||||
|
|
@ -188,29 +188,22 @@
|
||||||
* @brief 내용의 에디터 컴포넌트 코드를 변환
|
* @brief 내용의 에디터 컴포넌트 코드를 변환
|
||||||
**/
|
**/
|
||||||
function transEditorComponent($matches) {
|
function transEditorComponent($matches) {
|
||||||
// IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌
|
$script = sprintf(' %s editor_component=%s', $matches[1], $matches[2]);
|
||||||
$buff = $matches[0];
|
$script = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*) /i', fixQuotation, $script);
|
||||||
$buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $buff);
|
preg_match_all('/([a-z0-9\-\_]+)\=\"([^\"]+)\"/is', $script, $m);
|
||||||
$buff = str_replace("&","&",$buff);
|
for($i=0,$c=count($m[0]);$i<$c;$i++) {
|
||||||
|
$xml_obj->attrs->{$m[1][$i]} = $m[2][$i];
|
||||||
|
}
|
||||||
|
$xml_obj->body = $matches[3];
|
||||||
|
|
||||||
// 에디터 컴포넌트에서 생성된 코드
|
if(!$xml_obj->attrs->editor_component) return $matches[0];
|
||||||
$oXmlParser = new XmlParser();
|
|
||||||
$xml_doc = $oXmlParser->parse($buff);
|
|
||||||
if($xml_doc->div) $xml_doc = $xml_doc->div;
|
|
||||||
else if($xml_doc->img) $xml_doc = $xml_doc->img;
|
|
||||||
|
|
||||||
$xml_doc->body = $matches[3];
|
|
||||||
|
|
||||||
// attribute가 없으면 return
|
|
||||||
$editor_component = $xml_doc->attrs->editor_component;
|
|
||||||
if(!$editor_component) return $matches[0];
|
|
||||||
|
|
||||||
// component::transHTML() 을 이용하여 변환된 코드를 받음
|
// component::transHTML() 을 이용하여 변환된 코드를 받음
|
||||||
$oEditorModel = &getModel('editor');
|
$oEditorModel = &getModel('editor');
|
||||||
$oComponent = &$oEditorModel->getComponentObject($editor_component, 0);
|
$oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0);
|
||||||
if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0];
|
if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0];
|
||||||
|
|
||||||
return $oComponent->transHTML($xml_doc);
|
return $oComponent->transHTML($xml_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue