mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 15:19:57 +09:00
#19308996 글상자 인용구가 본문에서 스타일이 나타나지 않던 문제 수정(inline style로 표시하도록 필터 추가).
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7960 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
40b3c12b67
commit
a420f76836
1 changed files with 19 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ function editorStart_xe(editor_seq, primary_key, content_key, editor_height, col
|
|||
// filters
|
||||
xeed.cast('REGISTER_FILTER', ['r2t', plz_standard]);
|
||||
xeed.cast('REGISTER_FILTER', ['r2t', remove_baseurl]);
|
||||
xeed.cast('REGISTER_FILTER', ['in', inline_styled['in']]);
|
||||
xeed.cast('REGISTER_FILTER', ['out', inline_styled['out']]);
|
||||
|
||||
// Set standard API
|
||||
editorRelKeys[editor_seq] = {
|
||||
|
|
@ -81,6 +83,23 @@ function remove_baseurl(code) {
|
|||
return code.replace(reg, function(m0,m1,m2){ return ' '+m1+'='+m2; });
|
||||
}
|
||||
|
||||
// inline styled box
|
||||
var inline_styled = {
|
||||
'in' : function(code) {
|
||||
return code.replace(/<(div|blockquote)(?:[^>]*) class="(bx|bq)"(?:[^>]*)>/ig, '<$1 class="$2">');
|
||||
},
|
||||
'out' : function(code) {
|
||||
return code.replace(/<(div|blockquote)(?:[^>]*) class="(bx|bq)"(?:[^>]*)>/ig, function(a,tag,cls){
|
||||
if (tag == 'div' && cls == 'bx') {
|
||||
return '<'+tag+' class="'+cls+'" style="background:#fafafa;border:1px dotted #999;margin:1em 0;padding:0 2em">';
|
||||
} else if (tag == 'blockquote' && cls == 'bq') {
|
||||
return '<'+tag+' class="'+cls+'" style="border-left:3px solid #ccc;margin:1em 0;padding-left:1em">';
|
||||
}
|
||||
return a;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
window.editorStart_xe = editorStart_xe;
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue