From ac0fd24cea9d2fac33eec72dd0479b8e1f96ae6a Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 22 Mar 2007 09:05:51 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@609 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/components/slide_show/icon.gif | Bin 0 -> 1332 bytes .../slide_show/image_link.class.php | 66 +++++++++++++ .../components/slide_show/lang/ko.lang.php | 20 ++++ .../slide_show/tpl/images/align_left.gif | Bin 0 -> 379 bytes .../slide_show/tpl/images/align_middle.gif | Bin 0 -> 382 bytes .../slide_show/tpl/images/align_normal.gif | Bin 0 -> 379 bytes .../slide_show/tpl/images/align_right.gif | Bin 0 -> 368 bytes .../components/slide_show/tpl/popup.css | 77 +++++++++++++++ .../components/slide_show/tpl/popup.html | 64 ++++++++++++ .../editor/components/slide_show/tpl/popup.js | 92 ++++++++++++++++++ 10 files changed, 319 insertions(+) create mode 100644 modules/editor/components/slide_show/icon.gif create mode 100644 modules/editor/components/slide_show/image_link.class.php create mode 100644 modules/editor/components/slide_show/lang/ko.lang.php create mode 100644 modules/editor/components/slide_show/tpl/images/align_left.gif create mode 100644 modules/editor/components/slide_show/tpl/images/align_middle.gif create mode 100644 modules/editor/components/slide_show/tpl/images/align_normal.gif create mode 100644 modules/editor/components/slide_show/tpl/images/align_right.gif create mode 100644 modules/editor/components/slide_show/tpl/popup.css create mode 100644 modules/editor/components/slide_show/tpl/popup.html create mode 100644 modules/editor/components/slide_show/tpl/popup.js diff --git a/modules/editor/components/slide_show/icon.gif b/modules/editor/components/slide_show/icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..6151e27922349589675b09a6b474000c447592e3 GIT binary patch literal 1332 zcmchW|3A}t0LS0+m@Jo@L?~Y-j#I51S4y3%x_s%IWa^y6*@}_#H6E(Fp)+!Q9myPK z%J*;i)*>CYv6=X6)5UIj$oFLS-ACoit$*TPkLTm{c>VDD;q}YQ)BD)I{h>I31~a3; z49zk(WNq2V+G@nI*u=IpW?PxCtv9nVrW_k{&bBQaJBuEBs~!jIUPnyt4qGnv8}2T9 z?rsO3)3-e5?Y!@?eS3EG?Q`P0IrH83_Pe{j`q6#B^U$CdZqWPi;K^f9z-iGrUr|uN z(1mlaFNM4z5r!j)!_na*(Geptk>c1W@zu28xGUoLXff^Dp0I}p$>{;aNAAh-lHhw; zmuVi9Y+OpB;vQwgO# z^k%t)(iuQ*EhV>9QaYk;br30C=QAru1;zf^-9J&9T1DE>o}OLvHm7>9w0I`BdN8*d zqC8_hrqAToKo4u6JKeGOIKg-7#_n>$?)O}{-3;Z|YY{wXf@lo_T7$5l0it$i=5%N0 zal@#sg2G0@BObA+QBc$iIlH zf1iRi($*`S80c4aOa2}lQ1XT*p+Ob@^`sC|i3FPXba8TGX?kjD z?)}FP^Yhcv#c3%#y|6f=MW%T#Q+|*sXXT4hnc}@1URd}vuYhH;&r-$W2PG_3z)~eV zuYwm;uHi|6Nm&%Qba;H#y^~h@$^3F3v50j5&B>a?EJFi%UJ+w z6|BW>^=hDZrK2`&532B`J043K^2$jr8#muiHzP@yXF^KPLls#Tj&Z}-L#8fqK|H^) zLPF{|A&U^lP|aFYUEK;DX{uhXr|zlu8k z#69L^OlW+Vcb(g*CtqJr96yo@Hte-~kz%p~S1T|&6FW40E5|9ajnFS`&j^x#yJm`ASnLzIh6JtG0@QCK=K94*wmbxB9F|1rkY8^KE z2c}_$=>f=)_0`g--UTF(J41L!5W@Wq8Jr8ifU&=+t2hXBA}k3U1M{xTaa#wPp)%_( zgX^r9327VKhQl3nKrLPP3*Kj4r~%F;&P5l0Yc{-R_t6aR$(`}W`}J@Q6}||BZb+w& zYoRajK%I@Vy=`EG3<2xJ8z1X~&4ki0o3@>*6E6Ljv;7Q?SvudEanIcRI2Jf@a60!N ccw5FN%vF|OCy&osQ{&iuz`#G=*8?2*54kCi9smFU literal 0 HcmV?d00001 diff --git a/modules/editor/components/slide_show/image_link.class.php b/modules/editor/components/slide_show/image_link.class.php new file mode 100644 index 000000000..211444b22 --- /dev/null +++ b/modules/editor/components/slide_show/image_link.class.php @@ -0,0 +1,66 @@ +upload_target_srl = $upload_target_srl; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + require_once("./classes/template/TemplateHandler.class.php"); + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + $src = $xml_obj->attrs->src; + $alt = $xml_obj->attrs->alt; + $width = $xml_obj->attrs->width; + $height = $xml_obj->attrs->height; + $align = $xml_obj->attrs->align; + $border = $xml_obj->attrs->border; + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + if(!$alt) $alt = $src; + + $output = array(); + $output = array("src=\"".$src."\""); + if($alt) $output[] = "alt=\"".$alt."\""; + if($alt) $output[] = "title=\"".$alt."\""; + if($width) $output[] = "width=\"".$width."\""; + if($height) $output[] = "height=\"".$height."\""; + if($align) $output[] = "align=\"".$align."\""; + if($border) $output[] = "border=\"".$border."\""; + return ""; + } + + } +?> diff --git a/modules/editor/components/slide_show/lang/ko.lang.php b/modules/editor/components/slide_show/lang/ko.lang.php new file mode 100644 index 000000000..107223fa4 --- /dev/null +++ b/modules/editor/components/slide_show/lang/ko.lang.php @@ -0,0 +1,20 @@ + + * @brief 위지윅에디터(editor) 모듈 > 이미지링크(image_link) 컴포넌트의 언어팩 + **/ + + $lang->imagelink = "이미지 자료 연결"; + $lang->image_url = "이미지 경로"; + $lang->image_alt = "설명 입력"; + $lang->image_scale = "이미지크기"; + $lang->image_align = "정렬 방법 "; + $lang->image_align_normal = "한 문단을 차지"; + $lang->image_align_left = "글의 왼쪽으로"; + $lang->image_align_middle = "가운데"; + $lang->image_align_right = "글의 우측으로"; + $lang->image_border = "경계선 두께"; + + $lang->cmd_get_scale = "크기 구하기"; +?> diff --git a/modules/editor/components/slide_show/tpl/images/align_left.gif b/modules/editor/components/slide_show/tpl/images/align_left.gif new file mode 100644 index 0000000000000000000000000000000000000000..f16697d91a260fdb90951372750a05db74b614c2 GIT binary patch literal 379 zcmZ?wbhEHb6l0KLxXQrr|NsB{_wS!Nbt-7Bp3PFJ`i1KP*65_~w`siS6dTsef;IWM(fO*pZC7}pLl6u;2OQFZ~i+k zmt1yz$-_6F7{~&OKUu)~bU-A?PYi4`92yHebfj7vmK2>#QJQ_>nX$v#sP&Ccj8C!p ztY^px)qYX7KgsasnY&C}A9l=fh}gxgc3Pu2urNTXq%75oRYX@sT~0_zQB=Ovt6W$| zR$5h)Swca3Vzw6xhX6MhKc65wFXz0t7SDx?mo8tqy4jnBdFQU3Y&>i7cI@7@cmKK^ hzn09*`NvOqo=Qwudp79gsfaUIZr*agd)JY{8UU4=m|p+@ literal 0 HcmV?d00001 diff --git a/modules/editor/components/slide_show/tpl/images/align_middle.gif b/modules/editor/components/slide_show/tpl/images/align_middle.gif new file mode 100644 index 0000000000000000000000000000000000000000..5e9a00d35f63ce0c53ef551d9d6fb03a2e16b178 GIT binary patch literal 382 zcmZ?wbhEHb6l0KLxXQp#cFi&SxKr~(?}qzsjTe22uev%ck&M}G~~vg=Duy}cZ{-Dus7 zO&4B%^IoqUxJK{Ho1fw9%`U(BfAQtVV=v#Ie);y{n@^?Zg6@6!U%zmj%~GkLwR-pO z-#>Ng)c^ng8OQ>PKUu)~bU-A?PYi6c9i|m{=t#A$T~c&1MQQehXU3hYqSmjxQgq9y z)=fq5xX>z_P0`ncj%v92P2fF|_$p&+ObA=?!~h#DVJY5n&lpV>24*H!MlMcvj#l0F z&hFm+iIdy4=FXeT%{DvBOLPAGg^L4MS1ef*7_;7QiT2iQ+jnTUt=qKObLTeQoxAr2 n_#Zg2Ys#LZM-Cl4f8yNPwfnbv?YMYq6dTsef;IWM(fO*pZC7}pLl6u;2OQFZ~i+k zmt1yz$-_6F7{~&OKUu)~bU-A?PYi4`92yHebfj7vmK2>#QJQ_>nX$v#sP&Ccj8C!p ztY^px)qYX7KgsasnY&C}A9l=fh}gxgc3Pu2urNTXq%75oRYX@sT~0_zQB=Ovt6W$| zR$5h)Swca3Vzw6xhX6MhKc65wFXz0t7SDx?mo8tqy4jnBdFQU3Y&>i7cI@7@cmKK^ hzn09*`NvOqo=Qwudp79gsfaUIZr*agd)JY{8UU4=m|p+@ literal 0 HcmV?d00001 diff --git a/modules/editor/components/slide_show/tpl/images/align_right.gif b/modules/editor/components/slide_show/tpl/images/align_right.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ac97aa0be04c043014713f0d1e1fdd2052bb56a GIT binary patch literal 368 zcmZ?wbhEHb6l0KLxXQo~v{tWv;kw3)J`PJHomWWa9&jqY>Y9DrDPWCG`hJ_3-A0ky zjl$QP#qBk{{O13ux0n6bXsx@k>FS&R7hZmIUM~6i$A9nj%7JV2{I}RnytMGlo1af# z{U|*b6tTs~W~tQu`}a?sI`#kme+HTX#h)x-vvoiu$WIJxy$%x!JanX57cMC}nW8lN z!n4oLYulJ^c6g{LH{*UKPuOCaenZXxXq~>DqN!8x=R^ kmap03y?*D;&3pH4JFqKk_hG+1r&b<5x7YpBB}WEp0I(v1SpWb4 literal 0 HcmV?d00001 diff --git a/modules/editor/components/slide_show/tpl/popup.css b/modules/editor/components/slide_show/tpl/popup.css new file mode 100644 index 000000000..c2fc5eeb7 --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.css @@ -0,0 +1,77 @@ +.editor_window { + width:500px; + text-align:center; +} + +.editor_title { + font-size:10pt; + font-weight:bold; + clear:both; + height:20px; + background-color:#555555; + color:#EFEFEF; + vertical-align:middle; + padding-top:5px; + border-bottom:1px solid #000000; + text-align:center; +} + +.header { + float:left; + width:100px; + clear:left; + text-align:left; + font-weight:bold; + margin:5px; + font-size:9pt; +} + +.body { + float:left; + width:350px; + text-align:left; + margin:5px; + font-size:9pt; + font-size:9pt; +} + +.body label { + cursor:pointer; + font-size:9pt; +} + +.image_align { + margin:0px 0px 5px 0px; + float:left; + width:150px; +} + +.image_url { + width:350px; + height:13px; + font-size:9pt; + border:1px solid #AAAAAA; +} + +.editor_input { + width:40px; + height:13px; + font-size:9pt; + border:1px solid #AAAAAA; +} + +.editor_button_area { + border-top:1px solid #AAAAAA; + text-align:center; + background-color:#EEEEEE; + padding:2px 0px 2px 0px; + clear:both; +} + +.editor_button { + margin-top:4px; + background-color:#FFFFFF; + border:1px solid #AAAAAA; + height:16px; + font-size:9pt; +} diff --git a/modules/editor/components/slide_show/tpl/popup.html b/modules/editor/components/slide_show/tpl/popup.html new file mode 100644 index 000000000..07e9c9b3a --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.html @@ -0,0 +1,64 @@ + + + + +
+
+ +
{$lang->imagelink}
+ +
{$lang->image_url}
+
+ +
{$lang->image_scale}
+
+ px + px + +
+ + +
{$lang->image_alt}
+
+ +
{$lang->image_align}
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
{$lang->image_border}
+
px
+ +
+ + +
+
+
diff --git a/modules/editor/components/slide_show/tpl/popup.js b/modules/editor/components/slide_show/tpl/popup.js new file mode 100644 index 000000000..2dd39dcf0 --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.js @@ -0,0 +1,92 @@ +/** + * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 이미지가 있는지 체크하여 + * 있으면 가져와서 원하는 곳에 삽입 + **/ +function getImage() { + // 부모 위지윅 에디터에서 선택된 영역이 있는지 확인 + if(typeof(opener)=="undefined") return; + + // url이 미리 입력되어 있을 경우 scale구해줌 + if(xGetElementById("image_url").value) { + setTimeout(function() { getImageScale(); }, 500); + return; + } + + // 부모 위지윅 에디터에서 선택된 영역이 있으면 처리 + var node = opener.editorPrevNode; + if(!node || node.nodeName != "IMG") { + return; + } + var src = node.getAttribute("src"); + var border = node.getAttribute("border"); + var align = node.getAttribute("align"); + var alt = node.getAttribute("alt"); + var width = node.getAttribute("width"); + var height = node.getAttribute("height"); + + xGetElementById("image_url").value = src; + xGetElementById("image_alt").value = alt; + + switch(align) { + case 'left' : xGetElementById("align_left").checked = true; break; + case 'middle' : xGetElementById("align_middle").checked = true; break; + case 'right' : xGetElementById("align_right").checked = true; break; + default : xGetElementById("align_normal").checked = true; break; + } + + xGetElementById("image_border").value = border; + + xGetElementById("width").value = width; + xGetElementById("height").value = height; + +} + +function getImageScale() { + var url = xGetElementById("image_url").value; + if(!url) return; + + var img = new Image(); + img.src = url; + + xGetElementById("width").value = img.width; + xGetElementById("height").value = img.height; + +} +function insertImage(obj) { + if(typeof(opener)=="undefined") return; + + var url = xGetElementById("image_url").value; + var alt = xGetElementById("image_alt").value; + var align = ""; + if(xGetElementById("align_normal").checked==true) align = ""; + else if(xGetElementById("align_left").checked==true) align = "left"; + else if(xGetElementById("align_middle").checked==true) align = "middle"; + else if(xGetElementById("align_right").checked==true) align = "right"; + var border = parseInt(xGetElementById("image_border").value,10); + + var width = xGetElementById("width").value; + var height = xGetElementById("height").value; + + if(!url) { + window.close(); + return; + } + + var text = "