From f8c6aee7a24b46fabe3f89172824b54562d9c203 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2012 15:58:52 +0200 Subject: [PATCH 1/5] fixed selectionner widget --- .../Selectionner.wgt/css/basic.css | 420 +++++++++++++++ .../Selectionner.wgt/img/add_block.png | Bin 0 -> 1626 bytes .../Selectionner.wgt/img/circle.png | Bin 0 -> 1026 bytes .../Selectionner.wgt/img/close_cont.png | Bin 0 -> 772 bytes .../Selectionner.wgt/img/green_point.png | Bin 0 -> 721 bytes .../Selectionner.wgt/img/play.png | Bin 0 -> 1960 bytes .../Selectionner.wgt/img/red_point.png | Bin 0 -> 740 bytes .../Selectionner.wgt/img/replay.png | Bin 0 -> 2143 bytes .../Selectionner.wgt/img/stop.png | Bin 0 -> 1856 bytes .../Selectionner.wgt/js/script.js | 492 ++++++++++++++++++ .../Selectionner.wgt/locales/fr/js/script.js | 480 +++++++++++++++++ .../Selectionner.wgt/locales/ru/js/script.js | 478 +++++++++++++++++ 12 files changed, 1870 insertions(+) create mode 100644 resources/library/interactivities/Selectionner.wgt/css/basic.css create mode 100644 resources/library/interactivities/Selectionner.wgt/img/add_block.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/circle.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/close_cont.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/green_point.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/play.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/red_point.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/replay.png create mode 100644 resources/library/interactivities/Selectionner.wgt/img/stop.png create mode 100644 resources/library/interactivities/Selectionner.wgt/js/script.js create mode 100644 resources/library/interactivities/Selectionner.wgt/locales/fr/js/script.js create mode 100644 resources/library/interactivities/Selectionner.wgt/locales/ru/js/script.js diff --git a/resources/library/interactivities/Selectionner.wgt/css/basic.css b/resources/library/interactivities/Selectionner.wgt/css/basic.css new file mode 100644 index 00000000..6ae31837 --- /dev/null +++ b/resources/library/interactivities/Selectionner.wgt/css/basic.css @@ -0,0 +1,420 @@ +html, body{ + width: 100%; + height: 100%; + margin: 0; + padding: 0; + border-radius: 50px; +} + +body{ + background-image: url(../img/bg.png); +} + +.toggle_mode{ + width: 100%; + height: 25px; + border-bottom: 1px solid black; + background-color: #ccc; + position: fixed; + top: 0; + left: 0; + z-index: 2; +} + +#display_img, #edit_img{ + width: 15px; + height: 15px; + margin: 5px 10px; +} + +.green_point{ + background-image: url(../img/green_point.png); +} + +.red_point{ + background-image: url(../img/red_point.png); +} + +#display_text, #edit_text{ + height: 19px; + padding: 3px 0 0 0; +} + +.selected{ + +} + +#display:hover, #edit:hover{ + background-color: #999; +} + +.cont{ + width: 100%; + border-bottom: 1px solid black; + margin: 0; + padding: 0; + position: relative; +} + +.sub_cont{ + width: 100%; + padding: 0; + margin: 20px 0 0 0; + min-height: 60px; +} + +.imgs_cont{ + width: 100%; + margin: 0; +} + +.number_cont{ + width: 40px; + height: 33px; + margin-left: 40px; + margin-right: 10px; + background-image: url(../img/circle.png); + background-repeat: no-repeat; + text-align: center; + float: left; + font-size: 130%; + padding-top: 7px; + font-weight: bold; +} + +.text_cont{ + width: 80%; + min-height: 40px; + float: right; + background-color: #ccc; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + padding-left: 10px; +} + +.close_cont{ + width: 20px; + height: 20px; + background-image: url(../img/close_cont.png); + cursor: pointer; + position: absolute; + top: -15px; + left: 5px; +} + +.add_img{ + width: 120px; + height: 120px; + margin: 10px 20px; + background-image: url(../img/add_text.png); + background-position: center; + background-repeat: no-repeat; + cursor: pointer; + float: left; + display: inline-block; +} + +.img_block{ + display: inline-block; +} + +.img_block, .text_block{ + width: 120px; + height: 120px; + margin: 10px 20px; + cursor: pointer; + float: left; + position: relative; + border: 1px solid #ccc; + -moz-box-shadow: #ccc -1px 0 4px; + -webkit-box-shadow: #ccc -1px 0 4px; + box-shadow: #ccc -1px 0 4px; + background-color: white; +} + +.text_block{ + display: table; + text-align: center; +} + +.audio_block{ + width: 120px; + height: 30px; + margin: 44px 5px; + position: relative; + float: left; + display: inline-block; +} + +.text_subblock{ + display: table-cell; + vertical-align: middle; + font-size: 120%; +} + +.close_img, .clear_img, .numb_img { + width: 30px; + height: 30px; + background-repeat: no-repeat; + position: absolute; + right: -15px; + cursor: pointer; +} + +.close_img{ + background-image: url(../img/close_img.png); + top: -15px; +} + +.clear_img{ + background-image: url(../img/clear_img.png); + top: 15px; +} + +.numb_img{ + background-image: url(../img/numb_img.png); + left: -15px; + top: -15px; + color: white; + font-weight: bold; + font-size: 130%; +} + +.add_block{ + margin: 20px 0 0 20px; + width: 110px; + height: 25px; + background-image: url(../img/add_block.png); + background-repeat: no-repeat; + padding-left: 40px; + padding-top: 5px; + cursor: pointer; + background-color: #ccc; + -webkit-border-radius: 15px; + border-radius: 15px; +} + +.ch_box{ + margin: 0; + padding: 0; + position: absolute; + bottom: 0; + right: 0; +} + +.right{ + background-color: #9f9; +} + +.clear{ + clear: both; +} + +.over{ + background-color: #ccc; +} + +.play, .stop{ + height: 30px; + width: 70px; + float: left; + cursor: pointer; +} + +.play{ + background-image: url(../img/play.png); +} + +.stop{ + background-image: url(../img/stop.png); +} + +.replay{ + height: 30px; + width: 32px; + margin-left: 10px; + float: left; + background-image: url(../img/replay.png); + background-repeat: no-repeat; + cursor: pointer; +} + +/*new design*/ + +.body_table{ + width: 100%; + height: 100%; + border-spacing: 0; +} + +/*top*/ + +.b_top_left{ + width: 54px; + background-image: url(../img/top_left.png); + background-repeat: no-repeat; +} + +.b_top_right{ + width: 54px; + background-image: url(../img/top_right.png); + background-repeat: no-repeat; +} + +.b_top_center{ + height: 54px; + background-image: url(../img/top.png); + background-repeat: repeat-x; +} + +/*bottom*/ + +.b_bottom_left{ + width: 54px; + background-image: url(../img/bottom_left.png); + background-repeat: no-repeat; +} + +.b_bottom_right{ + width: 54px; + background-image: url(../img/bottom_right.png); + background-repeat: no-repeat; +} + +.b_bottom_center{ + background-image: url(../img/bottom.png); + background-repeat: repeat-x; +} + +/*center*/ + +.b_center_left{ + width: 54px; + background-image: url(../img/left.png); + background-repeat: repeat-y; +} + +.b_center_right{ + width: 54px; + background-image: url(../img/right.png); + background-repeat: repeat-y; +} + +#data{ + width: 100%; + height: 100%; + min-height: 250px; + overflow: auto; +} + +#wgt_name{ + height: 44px; + width: 200px; + margin: 10px 10px 0 10px; + padding: 0; + float: left; + /*font-family: "Lobster13Regular";*/ + font-size: 24px; + color: #8c5730; +} + +#wgt_reload, #wgt_edit, #wgt_display{ + cursor: pointer; + width: 80px; + height: 44px; + margin: 10px 10px 0 0; + float: right; + /*font-family: "Lobster13Regular";*/ + font-size: 24px; + color: #8c5730; +} + +#wgt_display{ + width: 100px; + padding-left: 40px; + background-image: url(../img/slate-edit.png); + background-repeat: no-repeat; + background-position: top 0; + display: none; +} + +#wgt_edit{ + width: 100px; + padding-left: 40px; + background-image: url(../img/slate-edit.png); + background-repeat: no-repeat; + background-position: top 0; +} + +#wgt_reload{ + padding-left: 40px; + background-image: url(../img/slate-toolbar-reload.png); + background-repeat: no-repeat; + background-position: top 0; +} + +.style_select{ + width: 120px; + /*font-family: "Lobster13Regular";*/ + font-size: 24px; + float: right; + margin: 10px 20px 0 0; + border-radius: 10px; + background-image: url(../img/ar_down.png); + background-color: #d4aa79; + color: #8c5730; + background-position: 105px 11px; + background-repeat: no-repeat; + -webkit-appearance: menulist-text; + display: none; +} + +.btl_pad{ + background-image: url(../img/pad-top-left.png) !important; +} + +.btc_pad{ + background-image: url(../img/pad-top.png) !important; +} + +.btr_pad{ + background-image: url(../img/pad-top-right.png) !important; +} + +.bcl_pad{ + background-image: url(../img/pad-left.png) !important; +} + +.bcr_pad{ + background-image: url(../img/pad-right.png) !important; +} + +.bbl_pad{ + background-image: url(../img/pad-bottom-left.png) !important; +} + +.bbc_pad{ + background-image: url(../img/pad-bottom.png) !important; +} + +.bbr_pad{ + background-image: url(../img/pad-bottom-right.png) !important; +} + +.pad_color{ + color: white !important; +} + +.pad_reload{ + background-image: url(../img/slate-toolbar-reload-white.png) !important; +} + +.pad_edit{ + background-image: url(../img/slate-display.png) !important; +} + +.pad_select{ + background-color: black !important; + color: white !important; + background-image: url(../img/ar_down_white.png) !important; +} diff --git a/resources/library/interactivities/Selectionner.wgt/img/add_block.png b/resources/library/interactivities/Selectionner.wgt/img/add_block.png new file mode 100644 index 0000000000000000000000000000000000000000..50f954080b88608e04a1562f95aee2f497ac1c16 GIT binary patch literal 1626 zcmV-g2BrClP)ht7!nc}5`$r5FlZts6c;YgkQf$f+>p3&hoCVjh;d^KTQ_QqrL2ev zl}B4k8v>QG=(IC)-}n0cXYRe789Jp#PkY;Q&pqdVe*gC$#WW0R9)1vzW7|Xu|0)#t z0V$f=rz*;j@B4f3?4*GD0t$+}AA1(@=f0|`H!vRyf?yQy_k0iMl!i=^NRXzgqzMu0 zQJ$c9v*&rouzc7L{6Pq99Ev1H1M5M<2vSvbTv3%Pm|w!ut$(c;ir(@){|x?b3#G1Y z1fgI>ofbkptElP)A=aiiW0~e>j^mu7|2Wu&WI~)vCR3+1O{+F57HxZTFysr;=> z^nVP)v`%_{P|D?UClR!TU|De^hQ99+JpI@(jN`}=hk8X9*q~%Gxx9vab80-C?=&Fy z4S;hYzi!>hrcj#_EVgYOtt?h9D-BewICvj&M-z8$)8Zn)3-6o#5mGfx8sfM%9eVXO zdilTsvMjT6zHwft+Dx&l^a}EQTV?Oedi`yLV>^FDopyXUtaEb@$g(YjI{_~R`JRWh zISBSwJkbh$aS9cS{#)p3@F`#v-<^5JcJyJ_T2KjuItN+AvBG5 zRRYnL-bRXf=qa5dW{dbHGOC3qd|$!(kYI1w(&oD5IWx_#KmS5Avv(;e8s(EpC24y4 zE@_$y#TGLq_9}E6D8Do^LYzD4mFrNsyPNjzeTkAd(;5ln8ajpRI(-qSB6BmD3{6c; z($`;|mtG_^A-#}ufGU+r!5b%z%*RIBi+OO;9`&VNf9DaeQj>a8FOxVEK&RMLq( zY2MS0hxT{IfDgl$5#1bY)HD_=On32N?BUwXX0uFn2$Mk~BzLaW6hOqF3qqDsLa-Sj z14cmPe5bP+YDr^gG%!>LnW*<|$9_Ro)F=)J^Ac^`w24j(zekf(Qxa5cG%KB)xI;Jp z9G9SJAlIS(fqr^!$1ZZc5L}i`PxbWBuEFP}L0tFC-Oq<3i3jM>iE$+VkfJSn?E0?U zaNyuU`9y%(P%hJVK<~A&Q7V;6a=ltxqAi=Z(7Pvw5uI8~xY6a{xzieE;0X~N7wL5R zYNfK^0t79!%%G^%YH@y8v7SzoVOc<>6Qi1m#4;_aR+n1Py9(zApxdiZoVk`rq{a=S zJ_zz&mAPd8kvmrEh6Lhb?!ZX-xecW4gF}v%I*D@p4Jp><(rNvN2;ChYzwzI&3^ez; ztW)kxCf?ao2HTUknn9e;=YNFqS-}U2h2luHT747rxxJIue30|i|MUR)jz^E?=Vd?U zF!usT?dWYEoVrvpHB%@SzF`7VkY8eD3kwTJXJ=3M(Ik9Y+&%vygH>`i(Gz|oza!NLSRcQzh?@i4ijD)wWMVA5wBYxI*tv^>T zmrrxaHzQrNhXso2$kzvjLg5cE*co`YjRkOiV@hmT5i?zEM66J@(CI?Ha27zi!0Bl( zFY$OzLbA~Hi<;1W$NU%w|1j=ZgS^g4qyb9P4KiqW$FvKh$3aS0(A6%Xh2Cm!LLC*i zbSdAT5()7MjJS}e{7|)4-2X#69< Y0H|PDf!Y4H@c;k-07*qoM6N<$g7eP`cK`qY literal 0 HcmV?d00001 diff --git a/resources/library/interactivities/Selectionner.wgt/img/circle.png b/resources/library/interactivities/Selectionner.wgt/img/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..4de395a37694609f06c158b5bfc3cabb319adc61 GIT binary patch literal 1026 zcmV+d1pWJoP)fWJK{)l$Jv9B9@k(#IK$TQbh^kpJ0eu5ld5p1gZzk$&Z^T z9!iqF&vdqoVU4>carc2InO)s|f0>!g&ilqi50{7ilI>?dWxLrv`L`H5#s0;PvLo!I z(M>X$3>8up?2rtavFND0wjvuamt7X%KC=7S)i@|GFQ=B47V`OgR99C=nx;{GeZBa{ z!^1;Lr_*$FbVRXOjCOZ->GJYYzt1UqF%pT4Z0c6 zW=mbax3@>@>+2MaM)gxa*dMr;!ubF$um{obdc8C{I!X-<4SCIxgM$N_o}Q*eBB7u9 z!jM6$fEtE@{R%@jGBQGeK%k(LIUEkt%*>3K3NqFJgQm>_egj--X(>%iOo+Kw3}J4D zLLs`jxxwKQ1HLu`D25eqv$L~QTU$%T)ba5#4G#~~_4T#kaBBu%h(Qc1dal@T5Mm$} zVj{N7XM6_!l^#@XM`&dx-}Ww*cp7BKPlKdvt`n|N7XUbY=jVc1l+Tc42e zBdLzZ(8$ za`vF|o2p*+dzt-FXJ;q%^z>NH0I|lcuCCI?#)f_hgp&-nlIuDvCE(BWuLLYIex!zN zZEd3b3%lKJ@eZN%n@Xj`JG`~Er9Zy(H5Vn|H#oSj1Z-8v_))9gChJA?ZFz0Adc#5% w(X-`~IrTHj{WHW*`CK*J&)xSk#9sjh0O|y((21~E;{X5v07*qoM6N<$g5_4*djJ3c literal 0 HcmV?d00001 diff --git a/resources/library/interactivities/Selectionner.wgt/img/close_cont.png b/resources/library/interactivities/Selectionner.wgt/img/close_cont.png new file mode 100644 index 0000000000000000000000000000000000000000..210b4d6dc089ad9277ab8a8c684438c2c4f6db69 GIT binary patch literal 772 zcmV+f1N;1mP)hQr~YTCF;a0Zr5Jo3UQ6F`LbBbaXVclPnsIIt~sFFr7|+OiHrt z?QL|sT^L-jb3w9RuZNeH7ufCg9}zAV3mhIE3WxYp$;`MQxzp){%jJS`6dN;E8F@S& zjK^bqe0+%S{{Ft$ZTz7VGb358R>Q@`g=}GWcUK6kWYp0{46*c~uL^9lMklyjF5~?C z9ECywudlC?Er}?cQ%4&y#L~w)OhQI@dwWAJmqR=r$K&H8^7*`Mi(8~{P91H;5KABH zv6zH5n@vg|4u^4leT`TwhUe#JoSvSVV9u$djTmC-Ltiz_lIprHG8&Drx3`C4v50Io z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y z_ZULDGDJ?Vcp<*ges?Ez4=E~PhjO3qvCI!)dwllrD`8iQLVS&(Tih~Sl*yJt|La2& zF#4W{?MEo3jK$FIOX@kVX`>o#jh}1Eo%PdP(??%r9qe}P zaqQVCNwA1@!}z;e$GNUIWf=-g)_PB-E zYBjzpb*=7Xkj#qP>B-4vr%h99f3Hd)4u<+~n!*RYt zh#tO=bYnv_x$c(qB9Ujm2QO>f0)A!O$fGsPw;jASh-GT8i(Rl_!QjI8-t5?C&r+p| z3B=m|{uM(5C0-H<%PW+8;ZE-A{Kf#IZN$pRV4<^b?6HvtPV7<##g8r9el3+M_+|3L zOBYwvyPLw6ImhHRP$k0$vLqei73J%vEqamQq1)b)UeWSo(5H)zGe@~+ty*F(S{69d z#(4e-BGUkmh3+x@R`&E?-`9nUZ?>B?zI zEO35H{8XeI!T6kS(^WR5l;6lXqyT;9f0%VIZz(ZwtBX$Z>S=lN920x6{1n2#ii4-_ z{drmO?J@N8=XS1nR9(O3N%iG@0iySZ{MvR>{Kubp(lLCBym;N-)1!PzFK^^bv^-SBb)>^S2~Zkm!ti)e_XG zC-#ROn)#xd2P}@t>y}_))AVF4WOshg8)5wM0!wIWx643cUc=QvnRn)39H^2RqGyb=V2>Pv|L?7 zka;iN5&O|J=EBTz%f&}FT#1I=KW6OD=WV}ldMS4gNQ!$msps0VurWusU9`*#`Vibe XSm?Ef?YFNwR8J#+p)vt!Yw literal 0 HcmV?d00001 diff --git a/resources/library/interactivities/Selectionner.wgt/js/script.js b/resources/library/interactivities/Selectionner.wgt/js/script.js new file mode 100644 index 00000000..a625e979 --- /dev/null +++ b/resources/library/interactivities/Selectionner.wgt/js/script.js @@ -0,0 +1,492 @@ +var sankoreLang = { + display: "Display", + edit: "Edit", + short_desc: "Select animals from the following list:", + add: "Add new block", + enter: "Enter your instruction here ...", + cat: "cat", + ball: "ball", + shovel: "shovel", + dog: "dog", + tree: "tree", + wgt_name: "Select the desired", + reload: "Reload", + slate: "Wood", + pad: "Pad" +}; + +//main function +function start(){ + + $("#wgt_display").text(sankoreLang.display); + $("#wgt_edit").text(sankoreLang.edit); + $("#wgt_name").text(sankoreLang.wgt_name); + $("#wgt_reload").text(sankoreLang.reload); + $(".style_select option[value='1']").text(sankoreLang.slate); + $(".style_select option[value='2']").text(sankoreLang.pad); + + if(window.sankore){ + if(sankore.preference("selectionner","")){ + var data = jQuery.parseJSON(sankore.preference("selectionner","")); + importData(data); + } else + showExample(); + if(sankore.preference("sel_style","")){ + changeStyle(sankore.preference("sel_style","")); + $(".style_select").val(sankore.preference("sel_style","")); + } else + changeStyle(1) + } + else + showExample(); + + //events + if (window.widget) { + window.widget.onleave = function(){ + exportData(); + sankore.setPreference("sel_style", $(".style_select").find("option:selected").val()); + } + } + + $("#wgt_reload").click(function(){ + if($("#wgt_display").hasClass("selected")){ + $(".cont").each(function(){ + var container = $(this); + container.find(".img_block, .text_block").each(function(){ + $(this).find("input:checkbox").removeAttr("checked"); + $(this).find("input:checkbox").parent().parent().removeClass("right"); + }); + }); + } + else + $("#wgt_display").trigger("click"); + }); + + $(".style_select").change(function (event){ + changeStyle($(this).find("option:selected").val()); + }) + + $("#wgt_display, #wgt_edit").click(function(event){ + if(this.id == "wgt_display"){ + if(!$(this).hasClass("selected")){ + if(window.sankore) + sankore.enableDropOnWidget(false); + $(this).addClass("selected"); + $("#wgt_edit").removeClass("selected"); + $(".style_select").css("display","none"); + $(".add_block").remove(); + $(".cont").each(function(){ + var container = $(this); + + container.find(".text_cont").removeAttr("contenteditable"); + container.find(".add_img").remove(); + container.find(".close_cont").remove(); + container.find(".imgs_cont").removeAttr("ondragenter") + .removeAttr("ondragleave") + .removeAttr("ondragover") + .removeAttr("ondrop"); + container.find(".img_block, .text_block").each(function(){ + $(this).find(".close_img").remove(); + $(this).find(".text_subblock").removeAttr("contenteditable"); + $(this).find("input:checkbox").removeAttr("checked") + }); + + }); + $(this).css("display", "none"); + $("#wgt_edit").css("display", "block"); + } + } else { + if(!$(this).hasClass("selected")){ + if(window.sankore) + sankore.enableDropOnWidget(true); + $(this).addClass("selected"); + $("#wgt_display").removeClass("selected"); + $(".style_select").css("display","block"); + + $(".cont").each(function(){ + var container = $(this); + + $("
").appendTo(container); + container.find(".text_cont").attr("contenteditable","true"); + container.find(".imgs_cont").removeClass("right") + .attr("ondragenter", "return false;") + .attr("ondragleave", "$(this).removeClass('over'); return false;") + .attr("ondragover", "$(this).addClass('over'); return false;") + .attr("ondrop", "$(this).removeClass('over'); return onDropTarget(this,event);"); + + var add_img = $("
"); + container.find(".img_block, .text_block").each(function(){ + $("
").appendTo($(this)); + if($(this).find("input:hidden").val() == 0) + $(this).find("input:checkbox").attr('checked', false); + else + $(this).find("input:checkbox").attr('checked', true); + $(this).find(".text_subblock").attr("contenteditable","true"); + }); + add_img.insertBefore(container.find(".clear")); + }); + + $("
" + sankoreLang.add + "
").appendTo("#data"); + $(this).css("display", "none"); + $("#wgt_display").css("display", "block"); + } + } + }); + + //add new block + $(".add_block").live("click", function(){ + addContainer(); + }); + + //checkbox events + $("input:checkbox").live("click", function(){ + if($("#wgt_display").hasClass("selected")){ + var flag = true; + var block = $(this).parent().parent(); + block.find(".text_block, .img_block, .audio_block").each(function(){ + if($(this).find("input:checkbox").is(':checked') && $(this).find("input:hidden").val() == 0) + flag = false; + else if(!$(this).find("input:checkbox").is(':checked') && $(this).find("input:hidden").val() == 1) + flag = false; + }); + if(flag) + block.addClass("right"); + else + block.removeClass("right"); + } else { + if($(this).is(":checked")) + $(this).parent().find("input:hidden").val(1); + else + $(this).parent().find("input:hidden").val(0); + } + }); + + //play/pause event + $(".play, .stop").live("click", function(){ + var tmp_audio = $(this); + var audio = tmp_audio.parent().find("audio").get(0); + if($(this).hasClass("play")){ + if(tmp_audio.parent().find("source").attr("src")){ + tmp_audio.removeClass("play").addClass("stop"); + var id = setInterval(function(){ + if(audio.currentTime == audio.duration){ + clearInterval(id); + tmp_audio.removeClass("stop").addClass("play"); + } + }, 10); + tmp_audio.parent().find("input").val(id); + audio.play(); + } + } else { + $(this).removeClass("stop").addClass("play"); + clearInterval( tmp_audio.parent().find("input").val()) + audio.pause(); + } + }); + + $(".replay").live("click", function(){ + var tmp_audio = $(this).prev(); + var audio = $(this).parent().find("audio").get(0); + if(tmp_audio.parent().find("source").attr("src")){ + $(this).prev().removeClass("play").addClass("stop"); + clearInterval($(this).parent().find("input").val()); + var id = setInterval(function(){ + if(audio.currentTime == audio.duration){ + clearInterval(id); + tmp_audio.removeClass("stop").addClass("play"); + } + }, 10); + tmp_audio.parent().find("input").val(id); + audio.currentTime = 0; + audio.play(); + } + }); + + //adding new img + $(".add_img").live("click", function(){ + addTextBlock($(this)); + }); + + //deleting a block + $(".close_cont").live("click",function(){ + $(this).parent().remove(); + refreshBlockNumbers(); + }); + + //deleting the img block + $(".close_img").live("click", function(){ + $(this).parent().remove(); + }); + + $("#wgt_reload, #wgt_display, #wgt_edit").live("mouseover",function(){ + exportData(); + }) +} + +//export +function exportData(){ + var array_to_export = []; + $(".cont").each(function(){ + var cont_obj = new Object(); + cont_obj.text = $(this).find(".text_cont").text(); + cont_obj.blocks = []; + $(this).find(".img_block, .audio_block, .text_block").each(function(){ + var tmp_block = new Object(); + if($("#wgt_display").hasClass("selected")) + tmp_block.state = "display"; + else + tmp_block.state = "edit"; + if($(this).hasClass("img_block")){ + if($(this).find(".audio_block").size() == 0){ + tmp_block.src = $(this).find("img").attr("src"); + tmp_block.hidden = $(this).find("input:hidden").val(); + tmp_block.h = $(this).find("img").height(); + tmp_block.w = $(this).find("img").width(); + tmp_block.type = "img"; + tmp_block.checked = $(this).find("input:checkbox").attr("checked"); + } + } + if($(this).hasClass("audio_block")){ + tmp_block.src = $(this).find("source").attr("src"); + tmp_block.hidden = $(this).parent().find("input:hidden").val(); + tmp_block.type = "audio"; + tmp_block.checked = $(this).find("input:checkbox").attr("checked"); + } + if($(this).hasClass("text_block")){ + tmp_block.text = $(this).find(".text_subblock").text(); + tmp_block.hidden = $(this).find("input:hidden").val(); + tmp_block.type = "text"; + tmp_block.checked = $(this).find("input:checkbox").attr("checked"); + } + cont_obj.blocks.push(tmp_block); + }); + array_to_export.push(cont_obj); + }); + + sankore.setPreference("selectionner", JSON.stringify(array_to_export)); +} + +//import +function importData(data){ + + var tmp = 0; + for(var i in data){ + + var container = $("
").appendTo("#data"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + $("
").appendTo(imgs_container); + + $("
" + (++tmp) + "
").appendTo(sub_container); + $("
" + data[i].text + "
").appendTo(sub_container); + + for(var j in data[i].blocks){ + switch(data[i].blocks[j].type){ + case "text": + var text_block = $("
").insertBefore(imgs_container.find(".clear")); + $("
" + data[i].blocks[j].text + "
").appendTo(text_block); + $("").appendTo(text_block); + $("").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(text_block); + break; + case "img": + var img_block = $("
").insertBefore(imgs_container.find(".clear")); + $("").appendTo(img_block); + $("").attr("checked",(data[i].blocks[j].state == "display")?((data[i].blocks[j].checked == "checked")?true:false):false).appendTo(img_block) + $("").appendTo(img_block); + break; + case "audio": + var img_tmp = $("
").insertBefore(imgs_container.find(".clear")); + var audio_block = $("
").appendTo(img_tmp); + $("
").appendTo(audio_block); + $("
").appendTo(audio_block); + var source = $("").attr("src", data[i].blocks[j].src); + var audio = $("