From a420f76836f5c56e9b89b1310ca4f693ecb5ab75 Mon Sep 17 00:00:00 2001 From: taggon Date: Thu, 9 Dec 2010 06:25:58 +0000 Subject: [PATCH] =?UTF-8?q?#19308996=20=EA=B8=80=EC=83=81=EC=9E=90=20?= =?UTF-8?q?=EC=9D=B8=EC=9A=A9=EA=B5=AC=EA=B0=80=20=EB=B3=B8=EB=AC=B8?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=8A=A4=ED=83=80=EC=9D=BC=EC=9D=B4=20?= =?UTF-8?q?=EB=82=98=ED=83=80=EB=82=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95(inline=20style=EB=A1=9C?= =?UTF-8?q?=20=ED=91=9C=EC=8B=9C=ED=95=98=EB=8F=84=EB=A1=9D=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=20=EC=B6=94=EA=B0=80).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7960 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/skins/xeed/js/xe_interface.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/editor/skins/xeed/js/xe_interface.js b/modules/editor/skins/xeed/js/xe_interface.js index 279820d82..f7034b5e5 100644 --- a/modules/editor/skins/xeed/js/xe_interface.js +++ b/modules/editor/skins/xeed/js/xe_interface.js @@ -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);