From 5606c37d2fe31604c86c20b1fb8e470790fde7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 15 Oct 2008 18:15:17 +0200 Subject: [PATCH] [svn r16548] adding plugin imagemap for fckeditor --- .../editor/plugins/imgmap/css/imgmap.css | 145 ++ .../editor/plugins/imgmap/docs/index.html | 11 + .../editor/plugins/imgmap/docs/install.html | 103 + .../plugins/imgmap/docs/installation.png | Bin 0 -> 4919 bytes .../editor/plugins/imgmap/docs/styles.css | 60 + .../editor/plugins/imgmap/fckplugin.js | 108 + .../editor/plugins/imgmap/images/accept.gif | Bin 0 -> 1024 bytes .../editor/plugins/imgmap/images/add.gif | Bin 0 -> 1010 bytes .../plugins/imgmap/images/bullet_green.gif | Bin 0 -> 282 bytes .../plugins/imgmap/images/bullet_orange.gif | Bin 0 -> 282 bytes .../editor/plugins/imgmap/images/circle.png | Bin 0 -> 310 bytes .../plugins/imgmap/images/clipboard.gif | Bin 0 -> 1039 bytes .../editor/plugins/imgmap/images/delete.gif | Bin 0 -> 1006 bytes .../editor/plugins/imgmap/images/edit.gif | Bin 0 -> 604 bytes .../editor/plugins/imgmap/images/html.gif | Bin 0 -> 1009 bytes .../plugins/imgmap/images/icon_default.gif | Bin 0 -> 169 bytes .../plugins/imgmap/images/icon_office2003.gif | Bin 0 -> 1001 bytes .../plugins/imgmap/images/icon_silver.gif | Bin 0 -> 169 bytes .../editor/plugins/imgmap/images/pointer.png | Bin 0 -> 265 bytes .../editor/plugins/imgmap/images/poly.png | Bin 0 -> 315 bytes .../editor/plugins/imgmap/images/rect.png | Bin 0 -> 267 bytes .../editor/plugins/imgmap/images/zoom.gif | Bin 0 -> 608 bytes .../plugins/imgmap/jscripts/excanvas.js | 19 + .../plugins/imgmap/jscripts/functions.js | 375 +++ .../editor/plugins/imgmap/jscripts/imgmap.js | 2020 +++++++++++++++++ .../editor/plugins/imgmap/jscripts/lang_en.js | 37 + .../editor/plugins/imgmap/jscripts/lang_es.js | 37 + .../editor/plugins/imgmap/lang/en.js | 24 + .../editor/plugins/imgmap/lang/es.js | 23 + .../editor/plugins/imgmap/license_GPL.txt | 280 +++ .../editor/plugins/imgmap/popup.html | 103 + .../editor/plugins/imgmap/readme.html | 11 + 32 files changed, 3356 insertions(+) create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/docs/styles.css create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/fckplugin.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/circle.png create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/clipboard.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/delete.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_default.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/rect.png create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/images/zoom.gif create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/excanvas.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/imgmap.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/lang_en.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/lang_es.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/lang/en.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/lang/es.js create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/license_GPL.txt create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/popup.html create mode 100644 main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css b/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css new file mode 100644 index 0000000000..a9a29686eb --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css @@ -0,0 +1,145 @@ +body { + overflow: hidden; +} + +FIELDSET { + margin: 0; + padding: 5px 5px; +} + +LEGEND { + background-image: url(../images/bullet_green.gif); + background-repeat: no-repeat; + background-position: left center; + padding-left: 15px; + padding-right: 5px; +} +LEGEND A { + border: none!important; + text-decoration: none; + cursor: pointer; +} + +.fieldset_off { + border-bottom: none; + border-right: none; +} +.fieldset_off LEGEND { + background-image: url(../images/bullet_orange.gif); +} +.fieldset_off DIV { + display: none; +} + +#img_area_form { + margin: 5px 0px; + padding: 0; + border: 0; +} + +#form_container { + white-space: nowrap; + overflow: auto; + height: 88px; + border-top: solid 1px #bfc1c5; +} + +#form_container INPUT, #form_container SELECT { + border: 1px solid black; + font-size: 10px; + margin: 0; + padding: 0 0 0 1px; +} + +.img_area { + display: block; + vertical-align: middle; + line-height: 20px; + height: 20px; +} + +.img_id { + font-weight: bold; + width: 25px; + padding: 0px 3px; + text-align: right; + border: none!important; + background: none; +} +.img_active { + border: none!important; +} +.img_coords { + width: 72px; +} +.img_href { + width: 82px; +} +.img_alt { + width: 82px; +} +.img_target { + width: 82px; +} + +#pic_container { + position: relative; + width: 100%; + height: 300px; + border: solid 0px #efefef; + overflow: auto; +} + +#pic_container .imgmap_label { + font: bold 10px Arial; + color: #100; + padding: 1px 2px; +} + +#status_container { + font-weight: bold!important; + font-size: 90%; + color: #e95949; + width: 100%; + height: 1em; +} + +#button_container { + padding: 5px; + line-height: 16px; +} +#button_container a { + outline: 0; +} +#button_container img { + border: 0; + padding: 1px; +} +#button_container .ActiveMode { + border: 1px solid #666; + padding: 0; + background-color: #ddd; +} + +#fieldset_html { + text-align: left; +} + +#html_container { + border: 1px solid black; + margin: 5px 0; + padding: 1px 0 0 1px; + height: 100px; + width: 100%; +} + +#properties { + clear:both; + border:1px solid #BFC1C5; + border-width:1px 0; + padding-bottom:0.8em; +} + +#properties td { + padding:2px 4px; +} \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html new file mode 100644 index 0000000000..001b080d41 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html @@ -0,0 +1,11 @@ + + + + imgmap plugin index + + + +

You should have been redirected to the documentation

+ + \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html new file mode 100644 index 0000000000..9cf26554a4 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html @@ -0,0 +1,103 @@ + + + + +Image Maps plugin + + + + +

Image Maps Plugin for FCKeditor

+ +

Introduction

+

This is a dialog-based plugin to handle insertion and modification of image map areas in FCKeditor

+

Authors:

+

Adam Maschek

+

Alfonso Martínez de Lizarrondo

+

Sponsored by:

+

claromentis.com

+

Version history:

+ +

Website:

+

Visit a demo of this plugin or a demo of the imgmap code

+ +

Known bugs:

+

None :-P

+

Installation

+

1. Copying the files

+

Extract the contents of the zip in you plugins directory, so it ends up like + this
+ Screenshot of installation

+
+editor\
+	...
+	js\
+	lang\
+	plugins\
+		...
+		imgmap\
+			excanvas.js
+			fckplugin.js
+			imgmap.js
+			css\
+			docs\
+			images\
+			jscripts\
+			lang\
+		...
+	skins\
+
+

2. Adding it to FCKeditor

+

Now add in your fckconfig.js or custom js configuration +file the following line: +FCKConfig.Plugins.Add( 'imgmap', 'en') ;

+

3. Adding it to the toolbarset

+

Add the button 'imgmapPopup' (case sensitive) to your toolbarset: +FCKConfig.ToolbarSets["Basic"] = [
+ ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink'],
+['Link','Unlink','Anchor'],
+['Image','imgmapPopup'],
+['FitWindow','-','About']
+] ;

+

4. Configure the plugin

+

Currently the plugin doesn't have any option to configure.

+

5. Use it

+

Now empty the cache of your browser and reload the editor, the + new button + Insert Image map should + be ready to use when you select an image.

+

Final notes

+

This plugin uses the imgmap code that it's available under a dual GPL/Commercial + license. You should check which + license is the right one for you.

+

Your help is always welcome supporting this project. Donations can be made + via the PayPal network using your PayPal account or any of the usual credit + cards. The security of the payment is provided by PayPal. To initiate a donation + just click on the buttons below that will take you to the PayPal website.
+Any amounts are appreciated, thank you for your help!

+ +

Donate to Adam:

+
+ + + + +
+

Donate to Alfonso:

+
+ + + + +
+

Disclaimers

+

FCKeditor is © FredCK.com

+

The core imgmap code is © Adam Maschek

+ + diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0e30fdf12de3233926f664bd25c95feefbc2ed GIT binary patch literal 4919 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 leJm>WIzU1dpH*Bu^fYH6n|C60l=*Q5G150Dl href + html = html.replace( /]+))/gi , '$& _fcksavedurl=$1' ) ; + + return html ; + } +} \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif new file mode 100644 index 0000000000000000000000000000000000000000..29f3ed7c97eb2e5bd17a7e6bab98d696377cfda0 GIT binary patch literal 1024 zcmZ?wbhEHb6krfw_&%Ru-JPX#Z%mqSuD<9*M)SGyKYxF3f4F|@!*x|>a`TQPIW08y z+@NmXYwfboIA>eftmEx7PPc8lxOLj;wk@}o)$U1Kdw+KQj?7u7+G7q_7aUKWu%~bR zon_CzK797&@#5>#ChqKCeR=lWbKTo6Y;8YOwD9`W!0mdKC$n$9xnkdKU4N?J%dby0 zyHXy!eqg;&z4BnntSh~RJEP0@B-9|3oj-CkkZZ+PIz&iq4(r6)4xUz)J}=GOefiTPV2bGL_Yxw$lNYefFmh~ndE zIY+&>-d_`Q*w(b(@Zp<>wcFFSKin|$Y?u8^o3fLc-6tyEet(^I)N{&-{-V>Nn&qme z-|XLbclqX#$!XmLDils2^$_i=Vfo6|K!7s z$3S&5b~>3_CysS9Ff(!pa1CI4JIO94&@9fw!C(yl Dux)$+ literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif new file mode 100644 index 0000000000000000000000000000000000000000..48ee701b98d163a71884b09060923f4c081b2365 GIT binary patch literal 1010 zcmZ?wbhEHb6krfw_}z9+%6-+uD``q!Ud?zy_NcvsBLmlxlEdsDkJJ9TyFjMHsf zZZ1t(5E?wyXVsOtC+{6Ob?@kz2gjD)o_*!@`NwY`9=*G>ep6P!OvfX4c5J)5X6yYm zwr!@%&QDu%ZpxjHH|h>%CeDl4dV9t0JL{eMEv8-R?%7@D+G{iYOl$V4h>jiQE^era7Nq7s;=|3>+dg{ezkk^&82N8Yo=Z9eDU$w^>>%1A8+0JWLw7S;J!00adW~v zdL8SI=Z8-7?cG=1w!Lt{&1rLQOxkgEeaeFH#xteMPcAIk9=-nl(#>~QZn?XvX=~om z7Y81{dsKNaWyYEIv_%oCugoc1lYaKW@#i0&ww|p#_wwY_D_vP@qL*Emma{6VW>-q# zzWCamSruDSI#1M3I@&P#Y)9qZyd8Jf_g!kP-BjJRu3bAT7u=jW^*~e2;p~DPk^jMfVHD6T z1QdU=FfuT7Gw6V90Obh=j`IxSoH8C85)Lwp^8F160`i-?c{pAeq&tZkrrhz+%vjLE zVPdYrV7Y0@d0`G_evXKTiX1a!RMzzTY@DsNyhO^ z5`6Ytl!5hC4WnW}zr2KQT~_Fn7tPHKOu7n%jw!FtyOb?hAuz+~0*_Up&>Y_>&s+NC zm|7orTuR|?*qn1|izK7Rg9eS5GY-C6-1;U;M4mH{lxTFEF5q`BBX9%5Q8p%4d7hmI d*ty#s%F7zeELi*c7}TUTEMVAJcCdlL8UXEPTekoJ literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif new file mode 100644 index 0000000000000000000000000000000000000000..c29051c5de4d14edff4d24adf85677e385327977 GIT binary patch literal 282 zcmZ?wbhEHb6krfwxT?%B|IVEFLs3)DOq#Z1;_I)k7GGKT^8JfLj}CU8=?IzW6FS## z_Ob2Fyznl$zF#3ff2b)V^)eR}%;|Nj|i02F_+FfuSGGw6WK2KkAB&HTW` z0uLRj{u4`zPTE8<2p?-(#G=E;>*y}okRqVa6ZD9~)`IKl)8Gp(HeO9DCP_%l`mv{O JJr5IuH2`SRVnzS} literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b567fbf7036ada8cf7f9d7de472ef5cd0278978 GIT binary patch literal 282 zcmZ?wbhEHb6krfwxT?(X|3vTqGn4;6-1Gm_)BpFjJzQ1)cvb!X1Ev3OtogsU`um%w zzxUSv|MKGhnJNDdxBfp+_kT~`|6}d{=a~P0xcC1;yZ^^}{(XA-pib-m*8KlRJ6^SE zecxICf06C~1y=u0xBWlZ^rTVi|H1P2om&6@|7V~9Q2fcl$iSe?paU`+C+kpFZ7O9`o_z$8FoTZQZ){?c2B47X&X{xbVZ3(i@AD z9&9bR(C_j2cEg%AYo0xOcCOp)-}`NU-)(*Q^5v3J^SN1CcUEUCEwf$)1QUy|%`uI~Bx%i*(%VxVuP;q{vcLZJ z=AvtJ0+uXU^8New&!0bEoZ|iO-@ikL4&9sWeRWR2trc;%W_z7&cRoKe=<)8V%QO7e zty_0`qR*`rsduJ1H)eQs6i2LX@Orqt_|7z^h3zTxa&)&(O5VJA^PQiv~Oca=z}eJk9L+V z?<=@AFL3_+`S&*E9BXm8K0oNghYwq}Y4_fZ|UUMh1pf1|5){ zpgh6A@rHq0w99!#!a*e_VJ@EJ7J*g{UMZIs4l7Pdw~B{d_^71l$i!*S6~v^Dq(}s`H{51o-H@Pgq@|5d!sZ*#3Yyu71D>gD}w>(oxWH`t-%b}h<)9gaigjN%Qygx66R&0E!%(m=-=f&nO vPR*QC8Q1UZuqx z&kp(6SM_5`{p0M!ugezxynNxQSFRMM9`rTd6=bqM#$kW3)sOW{ zzOG;TttsPKSirNWppSE=9f-7lSzqz<^pWSWkzcl~`dpd(YuCC@Ygc{Pw(W6V^0Nq^ zzjtnYUcUI->P7ov9NwNh{4C7p=gSx8l0v>LnD=2~{m)k~?p73kefIECeeKzVzz3-@ z*AhZ5_}g8N4gAnr@Nw?6+hN|13ew)C1-*$6c^T>Z9}E~q0bN2s@h1x-14BE54#+l8 zo?zfO&A`toHh zR)Nf5S65j+S&=gwi_%UoHgbpAC@yf}XqeA%CgZe;91-`ub>A=h^$zAd%K{7z#9H&+gmxx5+Q{MDuwuT&z#YZ`X MYy^_Uc{muX0eRS7x&QzG literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif new file mode 100644 index 0000000000000000000000000000000000000000..be24b456bc8122f6acfe0d6009403ac5d848e310 GIT binary patch literal 604 zcmZ?wbhEHb6krfwc$UoY{rmT?U%&qP_3Q8V%s%#eEat8=i^O39>spRT>0@z_1|wt{(pLK{qWMKSJofz z^Z0r{I?7q%{`~pL)itf@dVjwi`t#t(&yy4X ze}4M*RPMVQ8^6B3|Ltzh=O^ngZlCb}{reA>ww#$3dFarg(<}17KD}~vTh*z38$Nva z@bymohsV3Vy?gTM>E4sAj-ReoU6||k{ZaI~Y_(4>@9nFS`g$ks#;lNUm)AW%(Ea^k z)RjfqM`w6;CTjoq@#E*upTB?qK6&!wnKNhp{Q2|$|9=J=0L7myj0_CP3_2jQL2<&s zzOy0OI5DBMt(A>6xjQ*AHa=hDoLZ$^kaX2}ulb3=AfoM)q<} zR=Up1lHztS2pVYc2}OikL~Wap6d&uYC1z)>ukN#LQj#whvsa+MqDS}gNs^k(p^>5r zZV7iL$*Y-b3ybguCq2I?;qIU(&8cD=`{_lJs$RsxO|Hz{dVimlZa%2cF09GV;_*ei pmswoU)vD$uhv&jA{ga-_eqaikHQk__L&oBWkdFjYG7}?%H30T|C>Q_$ literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif new file mode 100644 index 0000000000000000000000000000000000000000..b936efe13b015c74daccf95be8781f92f7665c60 GIT binary patch literal 1009 zcmZ?wbhEHb6krfw_}o9SG^Y+PC?sY2`U#o9$9bC##n~5_R7z>bQH$ z*>}0~?zXRgk~{a#j6JX4efd+r^1&Ffa&O-LH-!uD1$E!_XubU9`ybEN8QTnb+j$EfRW5s2 zzT{cMs>dsiy|b)7@6voJeb$}r7d}PyU*C86!@`4aUVZ$v=H&ZjN8aCk@%_iIe`zys zJ%01^-plU~UjI0G`%CuhM_<1Gjht}z%Iyc+$A~ zv2^OmgsHa!d#;H(@14K@P15w+B6d6N>Ml69T>Jd}@9R&$CTxAa^4R-=1&>ZmWI`@{{R2aFbe1r0*XIb z7#SGa8FWClf${_c$2kUmP8p943l27O2=kd7*|4xnwPK$PM=*1HKYJTPM$aYYrm1R5 zT^bLBm3^Cf%Gdpv`O(pRf+L54NJhbvriFG2_ueQnxHX8&X@A+!a5%w(kApEtKtZsf za{(`-Mi1u^N2f``x-U{33l<-kX2rr08oA);Sw=0UPdqmi83Lwj);mq9NIGyxl9hQ% zhos>Fj_GCwDI5otR1e8m8!z1OlQE@{SEOi8$c%s&j_jst5*I!+Ea_o1%22Z?2+%k< aOFS*cK_x4tf8Vhi8>)M4+f z>{M<+Z$<}4k7CvOV9f^w3^vi*S5{Q-*tRDqaa+$$fs_vo3%9M@uKUB2g~1vC1!Xu& literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif new file mode 100644 index 0000000000000000000000000000000000000000..be98ae815d95cb6ef3a02bdb4e4e95d92300d4f5 GIT binary patch literal 1001 zcmZ?wbhEHb6krfw_|5R)hR;_?F%R$N%H z;liS=_n*z&cwy?H#|sWTS#jadiUa?*ocp)o!vC%J|L?wg=FFM<58hvV@a5(0v;WVW z`G4TT|HJqHAN%_M>gWI0zdZQx|Nn#c{~vt$|KbA}{QvOd|9_w$ko*sH#V8mJ0qTT+ z;!hSvkV!fq0+c5hIF2zea>#gWSm40NVVQGbf?_i>JCB4;KtVzK(QfO4I};S0U7NZj z%GWe7Ft&2>%QF_-__$!{>FFA*c?p?;?tL7>DlQcl7#kgUO>&v6 Qg)wNg*@;;R4h#&|0OnQ0kpKVy literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif new file mode 100644 index 0000000000000000000000000000000000000000..92ac8b4c3aa02c21f6a31cc861c78be0359ea999 GIT binary patch literal 169 zcmZ?wbhEHb6krfw*vtR|{}~ugH!%GF&(P4&aJr%4z<~q*fe6S4$)E$ppDc_F44e!) zAPJBe3@l*=Cp}lQSY+2;{O~}XX}W}vMB@a`29^RHejNiAHC>K_x4tf8Vhi8>)M4+f z>{M<+Z$<}4k7CvOV9f^w3^vi*S5{Q-*tRDqaa+$$fs_vo3%9M@uKUB2g~1vC1!Xu& literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png new file mode 100644 index 0000000000000000000000000000000000000000..7563bad9e08f9eeca6500ff97446ed8bd281b56a GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^Epd$~aV|QK$!8;-MT+OL4yFF5ZC_< z3?Ss>^uN3u#F#nr|AGYv4jlOZAIQT5|E=2^Rse+sN`m}?fohNe!vp15NuZp*r;B4q z#jWHY{H#14J@X5W)kq|(%`uceHiI+$OuJ!PlE*=wmQ_Fd6aLKUJjcMuuxx+XWaU}> QAg42Uy85}Sb4q9e0NAr!Jpcdz literal 0 HcmV?d00001 diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png new file mode 100644 index 0000000000000000000000000000000000000000..88329dfd322ee69b0659d0f38172ad159b97a030 GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^Epd$~aV|+Ak#PvS| z0|+@e{Vy*EF=o#EzhJ?E0|);92l6n%f9tk}6+mHuk|4iepc-Vr@IX0M5-6AG>Eakt zaVxY(k*~o(fW_a`V&4S?jXwKO2EJc-CVz02Pni@;1OBOz`!j8!i<;h*8Kqr8U*-+xc+Bg z03j!*|K;T%#>|=j7c4k%;K2X?KprOeZ{60g0w^p{666;QRD%o{9w^630_6-nT^vIy zZYBTVXXW8IR-^Iw`5ApZhX?0B)Vr~AFi76N?Z|NALqq3|$*PYYF_}u%Z^7-!d z`}g|&`uzUr@%hxSaQ5%yzK2co`26zs{Nl^G-^GvT)4JiwxWkfL&8A|~u7t#tSiz21 z(W`^q!jbXi*uHZ>@#fg9Wk1%nf0toK#g%Kzsg(Tr_s*wd^5@yXk6Or@VE6Iu`SkJJ zzop;Ar`fxV+Pi??#iONMGxO-$@%H=7p=a^;{L-#%DQ(E_w~PvQ1tlx z<+|~m|Nj6000000000000000000000000000000000000A^8LW004CWEC2ui z01yBW000NQfOT~TJU2ckIxjPVjDkrHS7B-oSyVL@je`zQ3juR+$ z26GAoX&H?@SO}}FbaWCf7maXebgiFs1quRAjTjFFbHfDy0Rj+>KtndUbN~PY5iL`V zL0$v_+5-a!3`-=9C~sOs5di^D3>sA*IE_duVr&8eZoZfybEeIhMjkk%fbb&@7bQlR uzzDG-Q="){var d="/"+a.tagName,e;while((e=a.nextSibling)&&e.tagName!=d){e.removeNode()}if(e){e.removeNode()}}a.parentNode.replaceChild(c,a);return c},initElement:function(a){a=this.q(a);a.getContext=function(){if(this.l){return this.l}return this.l=new K(this)};a.attachEvent("onpropertychange",V);a.attachEvent("onresize", +W);var b=a.attributes;if(b.width&&b.width.specified){a.style.width=b.width.nodeValue+"px"}else{a.width=a.clientWidth}if(b.height&&b.height.specified){a.style.height=b.height.nodeValue+"px"}else{a.height=a.clientHeight}return a}};function V(a){var b=a.srcElement;switch(a.propertyName){case "width":b.style.width=b.attributes.width.nodeValue+"px";b.getContext().clearRect();break;case "height":b.style.height=b.attributes.height.nodeValue+"px";b.getContext().clearRect();break}}function W(a){var b=a.srcElement; +if(b.firstChild){b.firstChild.style.width=b.clientWidth+"px";b.firstChild.style.height=b.clientHeight+"px"}}Q.init();var R=[];for(var E=0;E<16;E++){for(var F=0;F<16;F++){R[E*16+F]=E.toString(16)+F.toString(16)}}function J(){return[[1,0,0],[0,1,0],[0,0,1]]}function G(a,b){var c=J();for(var d=0;d<3;d++){for(var e=0;e<3;e++){var g=0;for(var h=0;h<3;h++){g+=a[d][h]*b[h][e]}c[d][e]=g}}return c}function N(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit= +a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.d=a.d;b.e=a.e}function O(a){var b,c=1;a=String(a);if(a.substring(0,3)=="rgb"){var d=a.indexOf("(",3),e=a.indexOf(")",d+1),g=a.substring(d+1,e).split(",");b="#";for(var h=0;h<3;h++){b+=R[Number(g[h])]}if(g.length==4&&a.substr(3,1)=="a"){c=g[3]}}else{b=a}return[b,c]}function S(a){switch(a){case "butt":return"flat";case "round":return"round"; +case "square":default:return"square"}}function K(a){this.a=J();this.m=[];this.k=[];this.c=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=m*1;this.globalAlpha=1;this.canvas=a;var b=a.ownerDocument.createElement("div");b.style.width=a.clientWidth+"px";b.style.height=a.clientHeight+"px";b.style.overflow="hidden";b.style.position="absolute";a.appendChild(b);this.j=b;this.d=1;this.e=1}var j=K.prototype;j.clearRect=function(){this.j.innerHTML= +"";this.c=[]};j.beginPath=function(){this.c=[]};j.moveTo=function(a,b){this.c.push({type:"moveTo",x:a,y:b});this.f=a;this.g=b};j.lineTo=function(a,b){this.c.push({type:"lineTo",x:a,y:b});this.f=a;this.g=b};j.bezierCurveTo=function(a,b,c,d,e,g){this.c.push({type:"bezierCurveTo",cp1x:a,cp1y:b,cp2x:c,cp2y:d,x:e,y:g});this.f=e;this.g=g};j.quadraticCurveTo=function(a,b,c,d){var e=this.f+0.6666666666666666*(a-this.f),g=this.g+0.6666666666666666*(b-this.g),h=e+(c-this.f)/3,l=g+(d-this.g)/3;this.bezierCurveTo(e, +g,h,l,c,d)};j.arc=function(a,b,c,d,e,g){c*=m;var h=g?"at":"wa",l=a+M(d)*c-A,n=b+L(d)*c-A,o=a+M(e)*c-A,f=b+L(e)*c-A;if(l==o&&!g){l+=0.125}this.c.push({type:h,x:a,y:b,radius:c,xStart:l,yStart:n,xEnd:o,yEnd:f})};j.rect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath()};j.strokeRect=function(a,b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.stroke()};j.fillRect=function(a, +b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill()};j.createLinearGradient=function(a,b,c,d){var e=new H("gradient");return e};j.createRadialGradient=function(a,b,c,d,e,g){var h=new H("gradientradial");h.n=c;h.o=g;h.i.x=a;h.i.y=b;return h};j.drawImage=function(a,b){var c,d,e,g,h,l,n,o,f=a.runtimeStyle.width,k=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var q=a.width,r=a.height;a.runtimeStyle.width= +f;a.runtimeStyle.height=k;if(arguments.length==3){c=arguments[1];d=arguments[2];h=(l=0);n=(e=q);o=(g=r)}else if(arguments.length==5){c=arguments[1];d=arguments[2];e=arguments[3];g=arguments[4];h=(l=0);n=q;o=r}else if(arguments.length==9){h=arguments[1];l=arguments[2];n=arguments[3];o=arguments[4];c=arguments[5];d=arguments[6];e=arguments[7];g=arguments[8]}else{throw"Invalid number of arguments";}var s=this.b(c,d),t=[],v=10,w=10;t.push(" ','","");this.j.insertAdjacentHTML("BeforeEnd",t.join(""))};j.stroke=function(a){var b=[],c=O(a?this.fillStyle:this.strokeStyle),d=c[0],e=c[1]*this.globalAlpha,g=10,h=10;b.push("n.x){n.x=k.x}if(l.y== +null||k.yn.y){n.y=k.y}}}b.push(' ">');if(typeof this.fillStyle=="object"){var v={x:"50%",y:"50%"},w=n.x-l.x,x=n.y-l.y,p=w>x?w:x;v.x=i(this.fillStyle.i.x/w*100+50)+"%";v.y=i(this.fillStyle.i.y/x*100+50)+"%";var y=[];if(this.fillStyle.p=="gradientradial"){var z=this.fillStyle.n/p*100,B=this.fillStyle.o/p*100-z}else{var z=0,B=100}var C={offset:null,color:null},D={offset:null,color:null};this.fillStyle.h.sort(function(T,U){return T.offset-U.offset});for(var o=0;oC.offset||C.offset==null){C.offset=u.offset;C.color=u.color}if(u.offset')}else if(a){b.push('')}else{b.push("')}b.push("");this.j.insertAdjacentHTML("beforeEnd",b.join(""));this.c=[]};j.fill=function(){this.stroke(true)};j.closePath=function(){this.c.push({type:"close"})};j.b=function(a,b){return{x:m*(a*this.a[0][0]+b*this.a[1][0]+this.a[2][0])-A,y:m*(a*this.a[0][1]+b*this.a[1][1]+this.a[2][1])-A}};j.save=function(){var a={};N(this,a); +this.k.push(a);this.m.push(this.a);this.a=G(J(),this.a)};j.restore=function(){N(this.k.pop(),this);this.a=this.m.pop()};j.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];this.a=G(c,this.a)};j.rotate=function(a){var b=M(a),c=L(a),d=[[b,c,0],[-c,b,0],[0,0,1]];this.a=G(d,this.a)};j.scale=function(a,b){this.d*=a;this.e*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];this.a=G(c,this.a)};j.clip=function(){};j.arcTo=function(){};j.createPattern=function(){return new P};function H(a){this.p=a;this.n=0;this.o= +0;this.h=[];this.i={x:0,y:0}}H.prototype.addColorStop=function(a,b){b=O(b);this.h.push({offset:1-a,color:b})};function P(){}G_vmlCanvasManager=Q;CanvasRenderingContext2D=K;CanvasGradient=H;CanvasPattern=P})()}; diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js new file mode 100644 index 0000000000..9504e56bf2 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js @@ -0,0 +1,375 @@ +var myimgmap; +var img_obj = null; +var map_obj = null; + +// Less boring code +window.$ = function( id ) +{ + return this.document.getElementById( id ) ; +} ; + +var oEditor = window.parent.InnerDialogLoaded(); +var FCKConfig = oEditor.FCKConfig ; +var FCKLang = oEditor.FCKLang ; + +document.write(''); + + +window.onload = function() +{ + window.parent.SetOkButton(true); +// window.parent.SetAutoSize(true); + + //translate page elements + oEditor.FCKLanguageManager.TranslatePage(document); + oEditor.FCKLanguageManager.TranslateElements(document, 'A', 'innerHTML'); + + var btn; + btn = $('imgpointer') ; + btn.alt = btn.title = FCKLang.imgmapPointer ; + btn = $('imgrectangle') ; + btn.alt = btn.title = FCKLang.imgmapRectangle ; + btn = $('imgcircle') ; + btn.alt = btn.title = FCKLang.imgmapCircle ; + btn = $('imgpolygon') ; + btn.alt = btn.title = FCKLang.imgmapPolygon ; + + + img_obj = oEditor.FCK.Selection.GetSelectedElement() ; + + // On rare situations it's possible to launch the dialog without an image selected + // -> in IE select an image, click outside the editor and the button will remain enabled, + // but img_obj will be null + if ( !img_obj ) + { + alert( FCKLang.msgImageNotSelected ) ; + window.parent.close() ; + return ; + } + + // Autoselect the language based on the current FCKeditor language + // Check if the plugin has the language file for the active language. + var sLang ; + if ( oEditor.FCKPlugins.Items['imgmap'].AvailableLangs.IndexOf( oEditor.FCKLanguageManager.ActiveLanguage.Code ) >= 0 ) + sLang = oEditor.FCKLanguageManager.ActiveLanguage.Code ; + else + // Load the english language file if the prefered by the user is not available. + sLang = "en" ; + + //late init + myimgmap = new imgmap({ + mode : "editor2", + button_container: $('button_container'), + imgroot: 'images/', + buttons : ['delete'], + custom_callbacks : { + 'onSelectArea' : onSelectArea, + 'onRemoveArea' : onRemoveArea + }, + html_container: null, + pic_container: $('pic_container'), + status_container: $('status_container'), + form_container: null, // $('form_container'), + bounding_box : false, + lang : sLang + }); + + //we need this to load languages + myimgmap.onLoad(); + + myimgmap.loadImage(img_obj); + + //check if the image has a valid map already assigned + var mapname = img_obj.getAttribute('usemap', 2) || img_obj.usemap ; + //console.log(mapname); + if ( typeof mapname == 'string' && mapname !== '') { + mapname = mapname.substr(1); + var maps = oEditor.FCK.EditorDocument.getElementsByTagName('MAP'); + //console.log(maps); + for (var i=0; i < maps.length; i++) { + if (maps[i].name == mapname) { + map_obj = maps[i]; + myimgmap.setMapHTML(map_obj); + + $('MapName').value = mapname ; + break; + } + } + } + + // We must set up this listener only after the current data has been read + myimgmap.config.custom_callbacks.onAddArea = onAddArea ; + + $('btnBrowse').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; + + if ( map_obj !== null ) + { + // Select the first area: + myimgmap.selectedId = 0 ; + onSelectArea( myimgmap.areas[0] ) ; + + setMode( 'pointer' ) ; + } + else + hightlightMode( 'rectangle' ) ; + + RefreshSize() ; +} ; + +function Ok() { + updateAreaValues() ; + + if (img_obj !== null && img_obj.nodeName == "IMG") { + var MapInnerHTML = getMapInnerHTML(myimgmap); + + // If there are no areas, then exit (and remove if neccesary the map). + if (MapInnerHTML == '') + { + removeMap(); + return ; + } + + oEditor.FCKUndo.SaveUndoStep(); + + if (typeof map_obj == 'undefined' || map_obj === null) { + map_obj = oEditor.FCK.EditorDocument.createElement('MAP'); + img_obj.parentNode.appendChild(map_obj); + } + + myimgmap.mapid = myimgmap.mapname = $('MapName').value ; + + map_obj.innerHTML = MapInnerHTML ; + + // IE bug: it's not possible to directly assing the name and make it work easily + // We remove the previous name + if ( map_obj.name ) + map_obj.removeAttribute( 'name' ) ; + + map_obj.name = myimgmap.getMapName(); + map_obj.id = myimgmap.getMapId(); + + img_obj.setAttribute('usemap', "#" + myimgmap.getMapName(), 0); + } + + return true; +} + +//remove the map object and unset the usemap attribute +function removeMap() { + oEditor.FCKUndo.SaveUndoStep(); + if (img_obj !== null && img_obj.nodeName == "IMG") { + img_obj.removeAttribute('usemap', 0); + } + if (typeof map_obj != 'undefined' && map_obj !== null) { + map_obj.parentNode.removeChild(map_obj); + } + + window.parent.close(); +} + + +function changelabeling(obj) { + myimgmap.config.label = obj.value; + myimgmap._repaintAll(); +} + +function toggleFieldset(fieldset, on) { + if (fieldset) { + if (fieldset.className == 'fieldset_off' || on == 1) { + fieldset.className = ''; + RefreshSize(); + } + else { + fieldset.className = 'fieldset_off'; + } + } +} + +// We need to store here the area id because if the user clicks on an area, +// then the onSelectArea event will fire before the onchange or onblur of the editing inputs +var currentAreaId = null ; + +// An area has been selected in the image +function onSelectArea(obj) { + $( 'properties' ).style.visibility = ''; + + updateAreaValues() ; + + currentAreaId = obj.aid ; + $( 'txtUrl' ).value = obj.ahref ; + $( 'cmbTarget' ).value = obj.atarget ; + $( 'txtAlt' ).value = obj.aalt ; + $( 'txtAttTitle' ).value = obj.atitle ; +} + +// A new area has been added +function onAddArea(id) { + $( 'properties' ).style.visibility = ''; + + updateAreaValues() ; + + currentAreaId = id ; + $( 'txtUrl' ).value = '' ; + $( 'cmbTarget' ).value = '' ; + $( 'txtAlt' ).value = '' ; + $( 'txtAttTitle' ).value = '' ; +} + +function onRemoveArea() +{ + currentAreaId = null ; + $( 'properties' ).style.visibility = 'hidden' ; +} + +function updateAreaValues() +{ + if (currentAreaId !== null) + { + myimgmap.areas[currentAreaId].ahref = $( 'txtUrl' ).value ; + myimgmap.areas[currentAreaId].aalt = $( 'txtAlt' ).value ; + myimgmap.areas[currentAreaId].atitle = $( 'txtAttTitle' ).value ; + myimgmap._recalculate(currentAreaId); + } +} + +// We use our own resizing because the default doesn't take into account Standards rendering mode. +function RefreshSize() +{ + var oInnerDoc = document ; + + var iFrameHeight ; + if ( document.all ) + iFrameHeight = oInnerDoc.documentElement.offsetHeight ; + else + iFrameHeight = window.innerHeight ; + + var iInnerHeight = oInnerDoc.body.scrollHeight ; + + var iDiff = iInnerHeight - iFrameHeight ; + + if ( iDiff !== 0 ) + { + if ( document.all ) + window.parent.dialogHeight = ( parseInt( window.parent.dialogHeight, 10 ) + iDiff ) + 'px' ; + else + window.parent.resizeBy( 0, iDiff ) ; + } +} + +function setMode(mode) { + if (mode == 'pointer') { + myimgmap.is_drawing = 0; + myimgmap.nextShape = ''; + } + else { + myimgmap.nextShape = mode; + } + + hightlightMode(mode); +} + +var previousModeImg = null ; +function hightlightMode(mode) { + // Reset previous button + if ( previousModeImg ) + previousModeImg.className = ''; + + // Highlight new mode + previousModeImg = $( 'img' + mode ); + previousModeImg.className = 'ActiveMode' ; +} + + + +/* Call our custom version to protect URLs */ + +function getMapInnerHTML( imgmap ) +{ + var html = '' ; + //foreach area properties + for (var i=0; i< imgmap.areas.length; i++) { + html+= getAreaHtml( imgmap.areas[i] ) ; + } + return(html); +} +// Protect urls and add only the used attributes +function getAreaHtml(area) +{ + if ( !area || area.shape == '') + return ''; + + var html = '0){ +this.pic.setAttribute("width",_23); +} +if(_24&&_24>0){ +this.pic.setAttribute("height",_24); +} +this.fireEvent("onLoadImage",this.pic); +}else{ +if(typeof img=="object"){ +var src=img.src; +if(src==""&&img.getAttribute("mce_src")!=""){ +src=img.getAttribute("mce_src"); +}else{ +if(src==""&&img.getAttribute("_fcksavedurl")!=""){ +src=img.getAttribute("_fcksavedurl"); +} +} +if(!_23){ +_23=img.clientWidth; +} +if(!_24){ +_24=img.clientHeight; +} +this.loadImage(src,_23,_24); +} +} +}; +imgmap.prototype.useImage=function(img){ +this.removeAllAreas(); +if(!this._getLastArea()){ +if(this.config.mode!="editor2"){ +this.addNewArea(); +} +} +img=this.assignOID(img); +if(typeof img=="object"){ +this.pic=img; +this.addEvent(this.pic,"mousedown",this.img_mousedown.bind(this)); +this.addEvent(this.pic,"mouseup",this.img_mouseup.bind(this)); +this.addEvent(this.pic,"mousemove",this.img_mousemove.bind(this)); +this.pic.style.cursor=this.config.cursor_default; +this.pic_container=this.pic.parentNode; +this.fireEvent("onLoadImage",this.pic); +} +}; +imgmap.prototype.statusMessage=function(str){ +if(this.status_container){ +this.status_container.innerHTML=str; +} +window.defaultStatus=str; +}; +imgmap.prototype.log=function(obj,_29){ +if(_29==""||typeof _29=="undefined"){ +_29=0; +} +if(this.config.loglevel!=-1&&_29>=this.config.loglevel){ +this.logStore.push({level:_29,obj:obj}); +} +if(typeof console=="object"){ +console.log(obj); +}else{ +if(this.isOpera){ +opera.postError(_29+": "+obj); +}else{ +if(_29>1){ +var msg=""; +for(var i=0;i"+this.getMapInnerHTML()+""; +this.fireEvent("onGetMap",_2c); +return (_2c); +}; +imgmap.prototype.getMapInnerHTML=function(){ +var _2d=""; +for(var i=0;i"; +} +} +} +return (_2d); +}; +imgmap.prototype.getMapName=function(){ +if(this.mapname==""){ +if(this.mapid!=""){ +return this.mapid; +} +var now=new Date(); +this.mapname="imgmap"+now.getFullYear()+(now.getMonth()+1)+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds(); +} +return this.mapname; +}; +imgmap.prototype.getMapId=function(){ +if(this.mapid==""){ +this.mapid=this.getMapName(); +} +return this.mapid; +}; +imgmap.prototype._normCoords=function(_30,_31){ +_30=_30.replace(/(\d)(\D)+(\d)/g,"$1,$3"); +_30=_30.replace(/,(\D|0)+(\d)/g,",$2"); +_30=_30.replace(/(\d)(\D)+,/g,"$1,"); +_30=_30.replace(/^(\D|0)+(\d)/g,"$2"); +var _32=_30.split(","); +if(_31=="rectangle"){ +if(!(parseInt(_32[1])>0)){ +_32[1]=_32[0]; +} +if(!(parseInt(_32[2])>0)){ +_32[2]=parseInt(_32[0])+10; +} +if(!(parseInt(_32[3])>0)){ +_32[3]=parseInt(_32[1])+10; +} +if(parseInt(_32[0])>parseInt(_32[2])){ +var _33=_32[0]; +_32[0]=_32[2]; +_32[2]=_33; +} +if(parseInt(_32[1])>parseInt(_32[3])){ +var _33=_32[1]; +_32[1]=_32[3]; +_32[3]=_33; +} +_30=_32[0]+","+_32[1]+","+_32[2]+","+_32[3]; +}else{ +if(_31=="circle"){ +if(!(parseInt(_32[1])>0)){ +_32[1]=_32[0]; +} +if(!(parseInt(_32[2])>0)){ +_32[2]=10; +} +_30=_32[0]+","+_32[1]+","+_32[2]; +} +} +return _30; +}; +imgmap.prototype.setMapHTML=function(map){ +this.fireEvent("onSetMap",map); +this.removeAllAreas(); +var _35; +if(typeof map=="string"){ +var _36=document.createElement("DIV"); +_36.innerHTML=map; +_35=_36.firstChild; +}else{ +if(typeof map=="object"){ +_35=map; +} +} +if(!_35||_35.nodeName.toLowerCase()!=="map"){ +return false; +} +this.mapname=_35.name; +this.mapid=_35.id; +var _37=_35.getElementsByTagName("area"); +for(var i=0;i<_37.length;i++){ +id=this.addNewArea(); +if(_37[i].getAttribute("shape",2)){ +shape=_37[i].getAttribute("shape",2).toLowerCase(); +if(shape=="rect"){ +shape="rectangle"; +}else{ +if(shape=="circ"){ +shape="circle"; +}else{ +if(shape=="poly"){ +shape="polygon"; +} +} +} +}else{ +shape="rectangle"; +} +if(this.props[id]){ +this.props[id].getElementsByTagName("select")[0].value=shape; +} +this.initArea(id,shape); +if(_37[i].getAttribute("coords",2)){ +var _39=this._normCoords(_37[i].getAttribute("coords",2),shape); +if(this.props[id]){ +this.props[id].getElementsByTagName("input")[2].value=_39; +} +this.areas[id].lastInput=_39; +} +var _3a=_37[i].getAttribute("href",2); +var _3b=_37[i].getAttribute("_fcksavedurl"); +if(_3b!=null){ +_3a=_3b; +} +if(_3a){ +if(this.props[id]){ +this.props[id].getElementsByTagName("input")[3].value=_3a; +} +this.areas[id].ahref=_3a; +} +var alt=_37[i].getAttribute("alt"); +if(alt){ +if(this.props[id]){ +this.props[id].getElementsByTagName("input")[4].value=alt; +} +this.areas[id].aalt=alt; +} +var _3d=_37[i].getAttribute("title"); +if(!_3d){ +_3d=alt; +} +if(_3d){ +this.areas[id].atitle=_3d; +} +var _3e=_37[i].getAttribute("target"); +if(_3e){ +_3e=_3e.toLowerCase(); +} +if(this.props[id]){ +this.props[id].getElementsByTagName("select")[1].value=_3e; +} +this.areas[id].atarget=_3e; +this._recalculate(id); +this.relaxArea(id); +if(this.html_container){ +this.html_container.value=this.getMapHTML(); +} +} +}; +imgmap.prototype.clickHtml=function(){ +this.fireEvent("onHtml"); +return true; +}; +imgmap.prototype.togglePreview=function(){ +if(!this.pic){ +return false; +} +if(this.viewmode==0){ +this.fireEvent("onPreview"); +for(var i=0;i\t\t\t\t\t\t\t\tShape:\t\t\t\t\tCoords: \t\t\t\tHref: \t\t\t\tAlt: \t\t\t\tTarget:\t"; +this.addEvent(this.props[id].getElementsByTagName("input")[1],"keydown",this.img_area_keydown.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("input")[2],"keydown",this.img_coords_keydown.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("input")[2],"blur",this.img_area_blur.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("input")[3],"blur",this.img_area_blur.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("input")[4],"blur",this.img_area_blur.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("select")[0],"blur",this.img_area_blur.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("select")[1],"blur",this.img_area_blur.bind(this)); +if(this.isSafari){ +this.addEvent(this.props[id].getElementsByTagName("select")[0],"change",this.img_area_click.bind(this)); +this.addEvent(this.props[id].getElementsByTagName("select")[1],"change",this.img_area_click.bind(this)); +} +if(_41&&this.config.mode=="editor"){ +this.props[id].getElementsByTagName("select")[0].value=_41.shape; +}else{ +if(this.nextShape){ +this.props[id].getElementsByTagName("select")[0].value=this.nextShape; +} +} +this.form_selectRow(id,true); +} +this.currentid=id; +return (id); +}; +imgmap.prototype.initArea=function(id,_44){ +if(!this.areas[id]){ +return false; +} +if(this.areas[id].parentNode){ +this.areas[id].parentNode.removeChild(this.areas[id]); +} +if(this.areas[id].label){ +this.areas[id].label.parentNode.removeChild(this.areas[id].label); +} +this.areas[id]=null; +this.areas[id]=document.createElement("CANVAS"); +this.pic.parentNode.appendChild(this.areas[id]); +this.pic.parentNode.style.position="relative"; +if(typeof G_vmlCanvasManager!="undefined"){ +this.areas[id]=G_vmlCanvasManager.initElement(this.areas[id]); +} +this.areas[id].id=this.mapname+"area"+id; +this.areas[id].aid=id; +this.areas[id].shape=_44; +this.areas[id].ahref=""; +this.areas[id].atitle=""; +this.areas[id].aalt=""; +this.areas[id].atarget=""; +this.areas[id].style.position="absolute"; +this.areas[id].style.top=this.pic.offsetTop+"px"; +this.areas[id].style.left=this.pic.offsetLeft+"px"; +this._setopacity(this.areas[id],this.config.CL_DRAW_BG,this.config.draw_opacity); +this.areas[id].onmousedown=this.area_mousedown.bind(this); +this.areas[id].onmouseup=this.area_mouseup.bind(this); +this.areas[id].onmousemove=this.area_mousemove.bind(this); +this.memory[id]=new Object(); +this.memory[id].downx=0; +this.memory[id].downy=0; +this.memory[id].left=0; +this.memory[id].top=0; +this.memory[id].width=0; +this.memory[id].height=0; +this.memory[id].xpoints=new Array(); +this.memory[id].ypoints=new Array(); +this.areas[id].label=document.createElement("DIV"); +this.pic.parentNode.appendChild(this.areas[id].label); +this.areas[id].label.className=this.config.label_class; +this.assignCSS(this.areas[id].label,this.config.label_style); +this.areas[id].label.style.position="absolute"; +}; +imgmap.prototype.relaxArea=function(id){ +if(!this.areas[id]){ +return; +} +this.fireEvent("onRelaxArea",id); +if(this.areas[id].shape=="rectangle"){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE; +}else{ +if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){ +if(this.config.bounding_box==true){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_NORM_BOX; +}else{ +this.areas[id].style.border=""; +} +} +} +this._setopacity(this.areas[id],this.config.CL_NORM_BG,this.config.norm_opacity); +}; +imgmap.prototype.relaxAllAreas=function(){ +for(var i=0;i0&&this.props[i]){ +this.form_selectRow((this.props.length-1),true); +} +} +} +}; +imgmap.prototype._putlabel=function(id){ +if(this.viewmode==1){ +return; +} +if(!this.areas[id].label){ +return; +} +try{ +if(this.config.label==""||this.config.label==false){ +this.areas[id].label.innerHTML=""; +this.areas[id].label.style.display="none"; +}else{ +this.areas[id].label.style.display=""; +var _4f=this.config.label; +_4f=_4f.replace(/%n/g,String(id)); +_4f=_4f.replace(/%c/g,String(this.areas[id].lastInput)); +_4f=_4f.replace(/%h/g,String(this.areas[id].ahref)); +_4f=_4f.replace(/%a/g,String(this.areas[id].aalt)); +_4f=_4f.replace(/%t/g,String(this.areas[id].atitle)); +this.areas[id].label.innerHTML=_4f; +} +this.areas[id].label.style.top=this.areas[id].style.top; +this.areas[id].label.style.left=this.areas[id].style.left; +} +catch(err){ +this.log("Error putting label",1); +} +}; +imgmap.prototype._puthint=function(id){ +try{ +if(this.config.hint==""||this.config.hint==false){ +this.areas[id].title=""; +this.areas[id].alt=""; +}else{ +var _51=this.config.hint; +_51=_51.replace(/%n/g,String(id)); +_51=_51.replace(/%c/g,String(this.areas[id].lastInput)); +_51=_51.replace(/%h/g,String(this.areas[id].ahref)); +_51=_51.replace(/%a/g,String(this.areas[id].aalt)); +_51=_51.replace(/%t/g,String(this.areas[id].atitle)); +this.areas[id].title=_51; +this.areas[id].alt=_51; +} +} +catch(err){ +this.log("Error putting hint",1); +} +}; +imgmap.prototype._repaintAll=function(){ +for(var i=0;iparseInt(_68[2])){ +throw "invalid coords"; +} +if(parseInt(_68[1])>parseInt(_68[3])){ +throw "invalid coords"; +} +this.areas[id].style.left=this.pic.offsetLeft+parseInt(_68[0])+"px"; +this.areas[id].style.top=this.pic.offsetTop+parseInt(_68[1])+"px"; +this.areas[id].style.width=(_68[2]-_68[0])+"px"; +this.areas[id].style.height=(_68[3]-_68[1])+"px"; +this.areas[id].setAttribute("width",(_68[2]-_68[0])); +this.areas[id].setAttribute("height",(_68[3]-_68[1])); +this._repaint(this.areas[id],this.config.CL_NORM_SHAPE); +}else{ +if(this.areas[id].shape=="circle"){ +if(_68.length!=3){ +throw "invalid coords"; +} +if(parseInt(_68[2])<0){ +throw "invalid coords"; +} +var _69=2*(1*_68[2]+1); +this.areas[id].style.width=_69+"px"; +this.areas[id].style.height=_69+"px"; +this.areas[id].setAttribute("width",_69); +this.areas[id].setAttribute("height",_69); +this.areas[id].style.left=this.pic.offsetLeft+parseInt(_68[0])-_69/2+"px"; +this.areas[id].style.top=this.pic.offsetTop+parseInt(_68[1])-_69/2+"px"; +this._repaint(this.areas[id],this.config.CL_NORM_SHAPE); +}else{ +if(this.areas[id].shape=="polygon"){ +if(_68.length<2){ +throw "invalid coords"; +} +this.areas[id].xpoints=new Array(); +this.areas[id].ypoints=new Array(); +for(var i=0;i<_68.length;i+=2){ +this.areas[id].xpoints[this.areas[id].xpoints.length]=this.pic.offsetLeft+parseInt(_68[i]); +this.areas[id].ypoints[this.areas[id].ypoints.length]=this.pic.offsetTop+parseInt(_68[i+1]); +this._polygongrow(this.areas[id],_68[i],_68[i+1]); +} +this._polygonshrink(this.areas[id]); +} +} +} +} +catch(err){ +this.log(err.message,1); +this.statusMessage(this.strings["ERR_INVALID_COORDS"]); +if(this.areas[id].lastInput&&_67){ +_67.value=this.areas[id].lastInput; +} +this._repaint(this.areas[id],this.config.CL_NORM_SHAPE); +return; +} +this.areas[id].lastInput=_66; +}; +imgmap.prototype._polygongrow=function(_6b,_6c,_6d){ +var _6e=_6c-parseInt(_6b.style.left); +var _6f=_6d-parseInt(_6b.style.top); +var pad=2; +var _71=pad*2; +if(_6cparseInt(_6b.style.left)+parseInt(_6b.style.width)){ +_6b.style.width=_6c-parseInt(_6b.style.left)+_71+"px"; +_6b.setAttribute("width",parseInt(_6b.style.width)); +} +if(_6d>parseInt(_6b.style.top)+parseInt(_6b.style.height)){ +_6b.style.height=_6d-parseInt(_6b.style.top)+_71+"px"; +_6b.setAttribute("height",parseInt(_6b.style.height)); +} +}; +imgmap.prototype._polygonshrink=function(_72){ +_72.style.left=(_72.xpoints[0]+1)+"px"; +_72.style.top=(_72.ypoints[0]+1)+"px"; +_72.style.height="0px"; +_72.style.width="0px"; +_72.setAttribute("height","0"); +_72.setAttribute("width","0"); +for(var i=0;i<_72.xpoints.length;i++){ +this._polygongrow(_72,_72.xpoints[i],_72.ypoints[i]); +} +this._repaint(_72,this.config.CL_NORM_SHAPE); +}; +imgmap.prototype.img_mousemove=function(e){ +if(this.viewmode==1){ +return; +} +var pos=this._getPos(this.pic); +var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x); +var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y); +x=x+this.pic_container.scrollLeft; +y=y+this.pic_container.scrollTop; +if(x<0||y<0||x>this.pic.width||y>this.pic.height){ +return; +} +if(this.memory[this.currentid]){ +var top=this.memory[this.currentid].top; +var _79=this.memory[this.currentid].left; +var _7a=this.memory[this.currentid].height; +var _7b=this.memory[this.currentid].width; +} +if(this.isSafari){ +if(e.shiftKey){ +if(this.is_drawing==this.DM_RECTANGLE_DRAW){ +this.is_drawing=this.DM_SQUARE_DRAW; +this.statusMessage(this.strings["SQUARE2_DRAW"]); +} +}else{ +if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_DRAW; +this.statusMessage(this.strings["RECTANGLE_DRAW"]); +} +} +} +if(this.is_drawing==this.DM_RECTANGLE_DRAW){ +this.fireEvent("onDrawArea",this.currentid); +var _7c=x-this.memory[this.currentid].downx; +var _7d=y-this.memory[this.currentid].downy; +this.areas[this.currentid].style.width=Math.abs(_7c)+"px"; +this.areas[this.currentid].style.height=Math.abs(_7d)+"px"; +this.areas[this.currentid].setAttribute("width",Math.abs(_7c)); +this.areas[this.currentid].setAttribute("height",Math.abs(_7d)); +if(_7c<0){ +this.areas[this.currentid].style.left=(x+1)+"px"; +} +if(_7d<0){ +this.areas[this.currentid].style.top=(y+1)+"px"; +} +}else{ +if(this.is_drawing==this.DM_SQUARE_DRAW){ +this.fireEvent("onDrawArea",this.currentid); +var _7c=x-this.memory[this.currentid].downx; +var _7d=y-this.memory[this.currentid].downy; +var _7e; +if(Math.abs(_7c)this.pic.width||y+_7a>this.pic.height){ +return; +} +if(x<0||y<0){ +return; +} +this.areas[this.currentid].style.left=x+1+"px"; +this.areas[this.currentid].style.top=y+1+"px"; +}else{ +if(this.is_drawing==this.DM_POLYGON_MOVE){ +this.fireEvent("onMoveArea",this.currentid); +var x=x-this.memory[this.currentid].rdownx; +var y=y-this.memory[this.currentid].rdowny; +if(x+_7b>this.pic.width||y+_7a>this.pic.height){ +return; +} +if(x<0||y<0){ +return; +} +var _7c=x-_79; +var _7d=y-top; +for(var i=0;i0){ +this.areas[this.currentid].style.left=x+1+"px"; +this.areas[this.currentid].style.top=(top+(_7e/2))+"px"; +this.areas[this.currentid].style.width=(_7b+(-1*_7e))+"px"; +this.areas[this.currentid].style.height=(_7a+(-1*_7e))+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].height=0; +this.memory[this.currentid].left=x; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT; +} +}else{ +if(this.is_drawing==this.DM_SQUARE_RESIZE_RIGHT){ +this.fireEvent("onResizeArea",this.currentid); +var _7e=x-_79-_7b; +if((_7b+(_7e))-1>0){ +this.areas[this.currentid].style.top=(top+(-1*_7e/2))+"px"; +this.areas[this.currentid].style.width=(_7b+(_7e))-1+"px"; +this.areas[this.currentid].style.height=(_7a+(_7e))+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].height=0; +this.memory[this.currentid].left=x; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_SQUARE_RESIZE_LEFT; +} +}else{ +if(this.is_drawing==this.DM_SQUARE_RESIZE_TOP){ +this.fireEvent("onResizeArea",this.currentid); +var _7e=y-top; +if((_7b+(-1*_7e))>0){ +this.areas[this.currentid].style.top=y+1+"px"; +this.areas[this.currentid].style.left=(_79+(_7e/2))+"px"; +this.areas[this.currentid].style.width=(_7b+(-1*_7e))+"px"; +this.areas[this.currentid].style.height=(_7a+(-1*_7e))+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].height=0; +this.memory[this.currentid].left=x; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM; +} +}else{ +if(this.is_drawing==this.DM_SQUARE_RESIZE_BOTTOM){ +this.fireEvent("onResizeArea",this.currentid); +var _7e=y-top-_7a; +if((_7b+(_7e))-1>0){ +this.areas[this.currentid].style.left=(_79+(-1*_7e/2))+"px"; +this.areas[this.currentid].style.width=(_7b+(_7e))-1+"px"; +this.areas[this.currentid].style.height=(_7a+(_7e))-1+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].height=0; +this.memory[this.currentid].left=x; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_SQUARE_RESIZE_TOP; +} +}else{ +if(this.is_drawing==this.DM_RECTANGLE_RESIZE_LEFT){ +this.fireEvent("onResizeArea",this.currentid); +var _7c=x-_79; +if(_7b+(-1*_7c)>0){ +this.areas[this.currentid].style.left=x+1+"px"; +this.areas[this.currentid].style.width=_7b+(-1*_7c)+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].left=x; +this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT; +} +}else{ +if(this.is_drawing==this.DM_RECTANGLE_RESIZE_RIGHT){ +this.fireEvent("onResizeArea",this.currentid); +var _7c=x-_79-_7b; +if((_7b+(_7c))-1>0){ +this.areas[this.currentid].style.width=(_7b+(_7c))-1+"px"; +this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width)); +}else{ +this.memory[this.currentid].width=0; +this.memory[this.currentid].left=x; +this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT; +} +}else{ +if(this.is_drawing==this.DM_RECTANGLE_RESIZE_TOP){ +this.fireEvent("onResizeArea",this.currentid); +var _7d=y-top; +if((_7a+(-1*_7d))>0){ +this.areas[this.currentid].style.top=y+1+"px"; +this.areas[this.currentid].style.height=(_7a+(-1*_7d))+"px"; +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].height=0; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM; +} +}else{ +if(this.is_drawing==this.DM_RECTANGLE_RESIZE_BOTTOM){ +this.fireEvent("onResizeArea",this.currentid); +var _7d=y-top-_7a; +if((_7a+(_7d))-1>0){ +this.areas[this.currentid].style.height=(_7a+(_7d))-1+"px"; +this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height)); +}else{ +this.memory[this.currentid].height=0; +this.memory[this.currentid].top=y; +this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP; +} +} +} +} +} +} +} +} +} +} +} +} +} +} +if(this.is_drawing){ +this._repaint(this.areas[this.currentid],this.config.CL_DRAW_SHAPE,x,y); +this._updatecoords(); +} +}; +imgmap.prototype.img_mouseup=function(e){ +if(this.viewmode==1){ +return; +} +var pos=this._getPos(this.pic); +var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x); +var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y); +x=x+this.pic_container.scrollLeft; +y=y+this.pic_container.scrollTop; +if(this.is_drawing!=this.DM_RECTANGLE_DRAW&&this.is_drawing!=this.DM_SQUARE_DRAW&&this.is_drawing!=this.DM_POLYGON_DRAW&&this.is_drawing!=this.DM_POLYGON_LASTDRAW){ +this.draggedId=null; +this.is_drawing=0; +this.statusMessage(this.strings["READY"]); +this.relaxArea(this.currentid); +if(this.areas[this.currentid]==this._getLastArea()){ +return; +} +this.memory[this.currentid].downx=x; +this.memory[this.currentid].downy=y; +} +}; +imgmap.prototype.img_mousedown=function(e){ +if(this.viewmode==1){ +return; +} +if(!this.areas[this.currentid]&&this.config.mode!="editor2"){ +return; +} +var pos=this._getPos(this.pic); +var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x); +var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y); +x=x+this.pic_container.scrollLeft; +y=y+this.pic_container.scrollTop; +if(!e){ +e=window.event; +} +if(e.shiftKey){ +if(this.is_drawing==this.DM_POLYGON_DRAW){ +this.is_drawing=this.DM_POLYGON_LASTDRAW; +} +} +if(this.is_drawing==this.DM_POLYGON_DRAW){ +this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5; +this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5; +this.memory[this.currentid].downx=x; +this.memory[this.currentid].downy=y; +return; +}else{ +if(this.is_drawing&&this.is_drawing!=this.DM_POLYGON_DRAW){ +if(this.is_drawing==this.DM_POLYGON_LASTDRAW){ +this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5; +this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5; +this._updatecoords(); +this.is_drawing=0; +this._polygonshrink(this.areas[this.currentid]); +} +this.is_drawing=0; +this.statusMessage(this.strings["READY"]); +this.relaxArea(this.currentid); +if(this.areas[this.currentid]==this._getLastArea()){ +if(this.config.mode!="editor2"){ +this.addNewArea(); +} +return; +} +return; +} +} +if(this.config.mode=="editor2"){ +if(this.nextShape==""){ +return; +} +this.addNewArea(); +this.initArea(this.currentid,this.nextShape); +}else{ +var _88=(this.props[this.currentid])?this.props[this.currentid].getElementsByTagName("select")[0].value:this.nextShape; +if(_88==""){ +_88="rectangle"; +} +this.initArea(this.currentid,_88); +} +if(this.areas[this.currentid].shape=="polygon"){ +this.is_drawing=this.DM_POLYGON_DRAW; +this.statusMessage(this.strings["POLYGON_DRAW"]); +this.areas[this.currentid].style.left=x+"px"; +this.areas[this.currentid].style.top=y+"px"; +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderWidth="1px"; +this.areas[this.currentid].style.borderStyle="dotted"; +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +this.areas[this.currentid].style.width=0; +this.areas[this.currentid].style.height=0; +this.areas[this.currentid].xpoints=new Array(); +this.areas[this.currentid].ypoints=new Array(); +this.areas[this.currentid].xpoints[0]=x; +this.areas[this.currentid].ypoints[0]=y; +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_DRAW; +this.statusMessage(this.strings["RECTANGLE_DRAW"]); +this.areas[this.currentid].style.left=x+"px"; +this.areas[this.currentid].style.top=y+"px"; +this.areas[this.currentid].style.borderWidth="1px"; +this.areas[this.currentid].style.borderStyle="dotted"; +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +this.areas[this.currentid].style.width=0; +this.areas[this.currentid].style.height=0; +}else{ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_DRAW; +this.statusMessage(this.strings["SQUARE_DRAW"]); +this.areas[this.currentid].style.left=x+"px"; +this.areas[this.currentid].style.top=y+"px"; +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderWidth="1px"; +this.areas[this.currentid].style.borderStyle="dotted"; +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +this.areas[this.currentid].style.width=0; +this.areas[this.currentid].style.height=0; +} +} +} +this.memory[this.currentid].downx=x; +this.memory[this.currentid].downy=y; +}; +imgmap.prototype.img_area_mouseover=function(e){ +if(this.is_drawing){ +return; +} +if(this.viewmode==1){ +return; +} +var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget; +if(typeof obj.aid=="undefined"){ +obj=obj.parentNode; +} +var id=obj.aid; +if(this.areas[id]&&this.areas[id].shape!="undefined"){ +this.fireEvent("onFocusArea",this.areas[id]); +if(this.areas[id].shape=="rectangle"){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_SHAPE; +}else{ +if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){ +if(this.config.bounding_box==true){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_BOX; +} +} +} +this._setopacity(this.areas[id],this.config.CL_HIGHLIGHT_BG,this.config.highlight_opacity); +this._repaint(this.areas[id],this.config.CL_HIGHLIGHT_SHAPE); +} +}; +imgmap.prototype.img_area_mouseout=function(e){ +if(this.is_drawing){ +return; +} +if(this.viewmode==1){ +return; +} +var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget; +if(typeof obj.aid=="undefined"){ +obj=obj.parentNode; +} +var id=obj.aid; +if(this.areas[id]&&this.areas[id].shape!="undefined"){ +this.fireEvent("onBlurArea",this.areas[id]); +if(this.areas[id].shape=="rectangle"){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE; +}else{ +if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){ +if(this.config.bounding_box==true){ +this.areas[id].style.borderWidth="1px"; +this.areas[id].style.borderStyle="solid"; +this.areas[id].style.borderColor=this.config.CL_NORM_BOX; +} +} +} +this._setopacity(this.areas[id],this.config.CL_NORM_BG,this.config.norm_opacity); +this._repaint(this.areas[id],this.config.CL_NORM_SHAPE); +} +}; +imgmap.prototype.img_area_click=function(e){ +if(this.viewmode==1){ +return; +} +var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget; +if(typeof obj.aid=="undefined"){ +obj=obj.parentNode; +} +this.form_selectRow(obj.aid,false); +this.currentid=obj.aid; +}; +imgmap.prototype.form_selectRow=function(id,_92){ +if(this.is_drawing){ +return; +} +if(this.viewmode==1){ +return; +} +if(!this.form_container){ +return; +} +if(!document.getElementById("img_active_"+id)){ +return; +} +document.getElementById("img_active_"+id).checked=1; +if(_92){ +document.getElementById("img_active_"+id).focus(); +} +for(var i=0;i6){ +if(obj.shape!="polygon"){ +obj.style.cursor="w-resize"; +} +}else{ +if(_9e>parseInt(obj.style.width)-6&&_9f>6){ +if(obj.shape!="polygon"){ +obj.style.cursor="e-resize"; +} +}else{ +if(_9e>6&&_9f<6){ +if(obj.shape!="polygon"){ +obj.style.cursor="n-resize"; +} +}else{ +if(_9f>parseInt(obj.style.height)-6&&_9e>6){ +if(obj.shape!="polygon"){ +obj.style.cursor="s-resize"; +} +}else{ +obj.style.cursor="move"; +} +} +} +} +if(obj.aid!=this.draggedId){ +if(obj.style.cursor=="move"){ +obj.style.cursor="default"; +} +return; +} +if(_9e<6&&_9f>6){ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_RESIZE_LEFT; +this.statusMessage(this.strings["SQUARE_RESIZE_LEFT"]); +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT; +this.statusMessage(this.strings["RECTANGLE_RESIZE_LEFT"]); +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +} +} +}else{ +if(_9e>parseInt(this.areas[this.currentid].style.width)-6&&_9f>6){ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT; +this.statusMessage(this.strings["SQUARE_RESIZE_RIGHT"]); +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT; +this.statusMessage(this.strings["RECTANGLE_RESIZE_RIGHT"]); +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +} +} +}else{ +if(_9e>6&&_9f<6){ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_RESIZE_TOP; +this.statusMessage(this.strings["SQUARE_RESIZE_TOP"]); +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP; +this.statusMessage(this.strings["RECTANGLE_RESIZE_TOP"]); +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +} +} +}else{ +if(_9f>parseInt(this.areas[this.currentid].style.height)-6&&_9e>6){ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM; +this.statusMessage(this.strings["SQUARE_RESIZE_BOTTOM"]); +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM; +this.statusMessage(this.strings["RECTANGLE_RESIZE_BOTTOM"]); +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +} +} +}else{ +if(this.areas[this.currentid].shape=="circle"){ +this.is_drawing=this.DM_SQUARE_MOVE; +this.statusMessage(this.strings["SQUARE_MOVE"]); +if(this.config.bounding_box==true){ +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX; +} +this.memory[this.currentid].rdownx=_9e; +this.memory[this.currentid].rdowny=_9f; +}else{ +if(this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_MOVE; +this.statusMessage(this.strings["RECTANGLE_MOVE"]); +this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE; +this.memory[this.currentid].rdownx=_9e; +this.memory[this.currentid].rdowny=_9f; +}else{ +if(this.areas[this.currentid].shape=="polygon"){ +for(var i=0;is){ +if(key==40&&_ae[i]>0){ +_ae[i]--; +} +if(key==38){ +_ae[i]++; +} +this._recalculate(this.currentid); +break; +} +j++; +} +obj.value=_ae.join(","); +this.setSelectionRange(obj,s); +return true; +} +}; +imgmap.prototype.doc_keydown=function(e){ +if(this.viewmode==1){ +return; +} +var key=(this.isMSIE)?event.keyCode:e.keyCode; +if(key==46){ +if(this.selectedId!=null&&!this.is_drawing){ +this.removeArea(); +} +}else{ +if(key==16){ +if(this.is_drawing==this.DM_RECTANGLE_DRAW){ +this.is_drawing=this.DM_SQUARE_DRAW; +this.statusMessage(this.strings["SQUARE2_DRAW"]); +} +} +} +}; +imgmap.prototype.doc_keyup=function(e){ +var key=(this.isMSIE)?event.keyCode:e.keyCode; +if(key==16){ +if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rectangle"){ +this.is_drawing=this.DM_RECTANGLE_DRAW; +this.statusMessage(this.strings["RECTANGLE_DRAW"]); +} +} +}; +imgmap.prototype.doc_mousedown=function(e){ +if(this.viewmode==1){ +return; +} +if(this.is_drawing==0){ +this.selectedId=null; +} +}; +imgmap.prototype._getPos=function(_b7){ +var _b8=0; +var _b9=0; +if(_b7){ +var _ba=_b7.offsetParent; +if(_ba){ +while((_ba=_b7.offsetParent)!=null){ +_b8+=_b7.offsetLeft; +_b9+=_b7.offsetTop; +_b7=_ba; +} +}else{ +_b8=_b7.offsetLeft; +_b9=_b7.offsetTop; +} +} +return new Object({x:_b8,y:_b9}); +}; +imgmap.prototype._getLastArea=function(){ +for(var i=this.areas.length-1;i>=0;i--){ +if(this.areas[i]){ +return this.areas[i]; +} +} +return null; +}; +imgmap.prototype.toClipBoard=function(_bc){ +this.fireEvent("onClipboard",_bc); +if(typeof _bc=="undefined"){ +_bc=this.getMapHTML(); +} +try{ +if(window.clipboardData){ +window.clipboardData.setData("Text",_bc); +}else{ +if(window.netscape){ +netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); +var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); +if(!str){ +return false; +} +str.data=_bc; +var _be=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); +if(!_be){ +return false; +} +_be.addDataFlavor("text/unicode"); +_be.setTransferData("text/unicode",str,_bc.length*2); +var _bf=Components.interfaces.nsIClipboard; +var _c0=Components.classes["@mozilla.org/widget/clipboard;1"].getService(_bf); +if(!_c0){ +return false; +} +_c0.setData(_be,null,_bf.kGlobalClipboard); +} +} +} +catch(err){ +this.log("Unable to set clipboard data",1); +} +}; +imgmap.prototype.assignCSS=function(obj,_c2){ +var _c3=_c2.split(";"); +for(var i=0;i<_c3.length;i++){ +var p=_c3[i].split(":"); +var pp=p[0].trim().split("-"); +var _c7=pp[0]; +for(var j=1;j + + + Image Map Editor + + + + + + + + + +
+
+ + Map + +
+ + +
+ +
+ +
+
+ +
+ + Image Map Areas + + +
+
+ + Pointer + Rectangle + Circle + Polygon +
+
+ +
+
+ + + +
+
+ +
+ + Preview + +
+
+
+ +
+ + diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html new file mode 100644 index 0000000000..161d74f094 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html @@ -0,0 +1,11 @@ + + + + imgmap plugin index + + + +

You should have been redirected to the documentation

+ + \ No newline at end of file