"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core-bundle/src/Resources/public/core.min.js" between
contao-4.11.3.tar.gz and contao-4.11.4.tar.gz

About: Contao (fka TYPOlight) is a content management system (CMS). Latest release.

core.min.js  (contao-4.11.3):core.min.js  (contao-4.11.4)
var AjaxRequest={themePath:Contao.script_url+"system/themes/"+Contao.theme+"/",t oggleNavigation:function(e,t,n){e.blur();var a=$(t),o=$(e).getParent("li");retur n a&&(o.hasClass("collapsed")?(o.removeClass("collapsed"),$(e).store("tip:title" ,Contao.lang.collapse),new Request.Contao({url:n}).post({action:"toggleNavigatio n",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(o.addClass("collapsed"),$ (e).store("tip:title",Contao.lang.expand),new Request.Contao({url:n}).post({acti on:"toggleNavigation",id:t,state:0,REQUEST_TOKEN:Contao.request_token}))),!1},to ggleStructure:function(i,l,s,r){i.blur();var e=$(l),c=$(i).getFirst("img");retur n e?"none"==e.getStyle("display")?(e.setStyle("display",null),c.src=AjaxRequest. themePath+"icons/folMinus.svg",$(i).store("tip:title",Contao.lang.collapse),new Request.Contao({field:i}).post({action:"toggleStructure",id:l,state:1,REQUEST_TO KEN:Contao.request_token})):(e.setStyle("display","none"),c.src=AjaxRequest.them ePath+"icons/folPlus.svg",$(i).store("tip:title",Contao.lang.expand),new Request .Contao({field:i}).post({action:"toggleStructure",id:l,state:0,REQUEST_TOKEN:Con tao.request_token})):new Request.Contao({field:i,evalScripts:!0,onRequest:AjaxRe quest.displayBox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new Eleme nt("li",{id:l,class:"parent",styles:{display:"inline"}});if(new Element("ul",{cl ass:"level_"+s,html:e}).inject(t,"bottom"),5==r)t.inject($(i).getParent("li"),"a fter");else{for(var n,a=!1,o=$(i).getParent("li");"element"==typeOf(o)&&(n=o.get Next("li"));)if((o=n).hasClass("tl_folder")){a=!0;break}a?t.inject(o,"before"):t .inject(o,"after")}t.getElements("a").each(function(e){e.href=e.href.replace(/&r ef=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(i).store("tip:title",Contao.lang.co llapse),c.src=AjaxRequest.themePath+"icons/folMinus.svg",window.fireEvent("struc ture"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"lo adStructure",id:l,level:s,state:1,REQUEST_TOKEN:Contao.request_token}),!1},toggl eFileManager:function(n,a,e,o){n.blur();var t=$(a),i=$(n).getFirst("img");return t?"none"==t.getStyle("display")?(t.setStyle("display",null),i.src=AjaxRequest.t hemePath+"icons/folMinus.svg",$(n).store("tip:title",Contao.lang.collapse),new R equest.Contao({field:n}).post({action:"toggleFileManager",id:a,state:1,REQUEST_T OKEN:Contao.request_token})):(t.setStyle("display","none"),i.src=AjaxRequest.the mePath+"icons/folPlus.svg",$(n).store("tip:title",Contao.lang.expand),new Reques t.Contao({field:n}).post({action:"toggleFileManager",id:a,state:0,REQUEST_TOKEN: Contao.request_token})):new Request.Contao({field:n,evalScripts:!0,onRequest:Aja xRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new El ement("li",{id:a,class:"parent",styles:{display:"inline"}});new Element("ul",{cl ass:"level_"+o,html:e}).inject(t,"bottom"),t.inject($(n).getParent("li"),"after" ),t.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&r ef="+Contao.referer_id)}),$(n).store("tip:title",Contao.lang.collapse),i.src=Aja xRequest.themePath+"icons/folMinus.svg",AjaxRequest.hideBox(),window.fireEvent(" ajax_change")}}).post({action:"loadFileManager",id:a,level:o,folder:e,state:1,RE QUEST_TOKEN:Contao.request_token}),!1},togglePagetree:function(n,a,e,t,o){n.blur (),Backend.getScrollOffset();var i=$(a),l=$(n).getFirst("img");return i?"none"== i.getStyle("display")?(i.setStyle("display",null),l.src=AjaxRequest.themePath+"i cons/folMinus.svg",$(n).store("tip:title",Contao.lang.collapse),new Request.Cont ao({field:n}).post({action:"togglePagetree",id:a,state:1,REQUEST_TOKEN:Contao.re quest_token})):(i.setStyle("display","none"),l.src=AjaxRequest.themePath+"icons/ folPlus.svg",$(n).store("tip:title",Contao.lang.expand),new Request.Contao({fiel d:n}).post({action:"togglePagetree",id:a,state:0,REQUEST_TOKEN:Contao.request_to ken})):new Request.Contao({field:n,evalScripts:!0,onRequest:AjaxRequest.displayB ox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new Element("li",{id:a, class:"parent",styles:{display:"inline"}});new Element("ul",{class:"level_"+o,ht ml:e}).inject(t,"bottom"),t.inject($(n).getParent("li"),"after"),t.getElements(" a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.refer er_id)}),$(n).store("tip:title",Contao.lang.collapse),l.src=AjaxRequest.themePat h+"icons/folMinus.svg",AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}). post({action:"loadPagetree",id:a,level:o,field:e,name:t,state:1,REQUEST_TOKEN:Co ntao.request_token}),!1},toggleFiletree:function(n,a,e,t,o,i){n.blur(),Backend.g etScrollOffset();var l=$(a),s=$(n).getFirst("img");return l?"none"==l.getStyle(" display")?(l.setStyle("display",null),s.src=AjaxRequest.themePath+"icons/folMinu s.svg",$(n).store("tip:title",Contao.lang.collapse),new Request.Contao({field:n} ).post({action:"toggleFiletree",id:a,state:1,REQUEST_TOKEN:Contao.request_token} )):(l.setStyle("display","none"),s.src=AjaxRequest.themePath+"icons/folPlus.svg" ,$(n).store("tip:title",Contao.lang.expand),new Request.Contao({field:n}).post({ action:"toggleFiletree",id:a,state:0,REQUEST_TOKEN:Contao.request_token})):new R equest.Contao({field:n,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.la ng.loading+" …"),onSuccess:function(e){var t=new Element("li",{id:a,class:"paren t",styles:{display:"inline"}});new Element("ul",{class:"level_"+i,html:e}).injec t(t,"bottom"),t.inject($(n).getParent("li"),"after"),t.getElements("a").each(fun ction(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(n ).store("tip:title",Contao.lang.collapse),s.src=AjaxRequest.themePath+"icons/fol Minus.svg",AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action :"loadFiletree",id:a,folder:e,level:i,field:t,name:o,state:1,REQUEST_TOKEN:Conta o.request_token}),!1},toggleSubpalette:function(a,o,e){a.blur();var t=$(o);t?a.v alue?(a.value="",a.checked="",t.setStyle("display","none"),t.getElements("[requi red]").each(function(e){e.set("required",null).set("data-required","")}),new Req uest.Contao({field:a}).post({action:"toggleSubpalette",id:o,field:e,state:0,REQU EST_TOKEN:Contao.request_token})):(a.value=1,a.checked="checked",t.setStyle("dis play",null),t.getElements("[data-required]").each(function(e){e.set("required"," ").set("data-required",null)}),new Request.Contao({field:a}).post({action:"toggl eSubpalette",id:o,field:e,state:1,REQUEST_TOKEN:Contao.request_token})):new Requ est.Contao({field:a,evalScripts:!1,onRequest:AjaxRequest.displayBox(Contao.lang. loading+" …"),onSuccess:function(e,t){var n=new Element("div",{id:o,class:"subpa l cf",html:e,styles:{display:"block"}}).inject($(a).getParent("div").getParent(" div"),"after");t.javascript&&(document.write=function(e){var n="";e.replace(/<sc ript src="([^"]+)"/i,function(e,t){n=t}),n&&Asset.javascript(n,{onLoad:function( ){Browser.exec(t.javascript)}})},Browser.exec(t.javascript)),a.value=1,a.checked ="checked",n.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0 -9]+/,"&ref="+Contao.referer_id)}),AjaxRequest.hideBox(),window.fireEvent("subpa lette"),window.fireEvent("ajax_change")}}).post({action:"toggleSubpalette",id:o, field:e,load:1,state:1,REQUEST_TOKEN:Contao.request_token})},toggleVisibility:fu nction(e,t,n){e.blur();var a,o,i,l,s,r,c=null,d=$(e).getFirst("img"),u=1==d.get( "data-state"),g=e.getParent("div");return null===d.get("data-state")&&(u=-1==d.s rc.indexOf("invisible"),window.console&&console.warn('Using a visibility toggle without a "data-state" attribute is deprecated. Please adjust your Contao DCA fi le.')),g.hasClass("tl_right")?c=g.getPrevious("div").getElement("img"):g.hasClas s("tl_listing_container")?(null===(c=e.getParent("td").getPrevious("td").getFirs t("div.list_icon"))&&(c=e.getParent("td").getPrevious("td").getElement("div.cte_ type")),null===c&&(c=e.getParent("tr").getFirst("td").getElement("div.list_icon_ new"))):(o=g.getNext("div"))&&(o.hasClass("cte_type")&&(c=o),null===c&&(c=o.getF irst("div.list_icon"))),null!==c&&("img"==c.nodeName.toLowerCase()?(c.getParent( "ul.tl_listing").hasClass("tl_tree_xtnd")?(i=c.get("data-icon"),l=c.get("data-ic on-disabled"),null===i&&(i=c.src.replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|sv g)$/,"$1/$2.$3"),window.console&&console.warn('Using a row icon without a "data- icon" attribute is deprecated. Please adjust your Contao DCA file.')),null===l&& (l=c.src.replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)$/,"$1/$2_.$3"),window .console&&console.warn('Using a row icon without a "data-icon-disabled" attribut e is deprecated. Please adjust your Contao DCA file.'))):((s=c.getParent("a"))&& -1==s.href.indexOf("contao/preview")&&(c=(o=s.getNext("a"))?o.getFirst("img"):ne w Element("img")),i=c.get("data-icon"),l=c.get("data-icon-disabled"),null===i&&( a=c.src.replace(/.*_([0-9])\.(gif|png|jpe?g|svg)/,"$1"),i=c.src.replace(/_[0-9]\ .(gif|png|jpe?g|svg)/,(1==a.toInt()?"":"_"+(a.toInt()-1))+".$1").split(/[\\/]/). pop(),window.console&&console.warn('Using a row icon without a "data-icon" attri bute is deprecated. Please adjust your Contao DCA file.')),null===l&&(a=c.src.re place(/.*_([0-9])\.(gif|png|jpe?g|svg)/,"$1"),l=c.src.replace(/(_[0-9])?\.(gif|p ng|jpe?g|svg)/,(a==c.src?"_1":"_"+(a.toInt()+1))+".$2").split(/[\\/]/).pop(),win dow.console&&console.warn('Using a row icon without a "data-icon-disabled" attri bute is deprecated. Please adjust your Contao DCA file.'))),-1==i.indexOf("/")&& (i=AjaxRequest.themePath+(i.match(/\.svg$/)?"icons/":"images/")+i),-1==l.indexOf ("/")&&(l=AjaxRequest.themePath+(l.match(/\.svg$/)?"icons/":"images/")+l),c.src= u?l:i):c.hasClass("cte_type")?u?(c.addClass("unpublished"),c.removeClass("publis hed")):(c.addClass("published"),c.removeClass("unpublished")):(i=c.get("data-ico n"),l=c.get("data-icon-disabled"),null===i&&(i=c.getStyle("background-image").re place(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)\);?$/,"$1/$2.$2"),window.console &&console.warn('Using a row icon without a "data-icon" attribute is deprecated. Please adjust your Contao DCA file.')),null===l&&(l=c.getStyle("background-image ").replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)\);?$/,"$1/$2_.$3"),window.c onsole&&console.warn('Using a row icon without a "data-icon-disabled" attribute is deprecated. Please adjust your Contao DCA file.')),-1==i.indexOf("/")&&(i=Aja xRequest.themePath+(i.match(/\.svg$/)?"icons/":"images/")+i),-1==l.indexOf("/")& &(l=AjaxRequest.themePath+(l.match(/\.svg$/)?"icons/":"images/")+l),c.setStyle(" background-image","url("+(u?l:i)+")"))),"tl_style"==n&&g.getParent("div").getEle ment("pre").toggleClass("disabled"),u?(d.src=AjaxRequest.themePath+"icons/invisi ble.svg",d.set("data-state",0),(r={state:0,rt:Contao.request_token})[$(e).get("d ata-tid")||"tid"]=t):(d.src=AjaxRequest.themePath+"icons/visible.svg",d.set("dat a-state",1),(r={state:1,rt:Contao.request_token})[$(e).get("data-tid")||"tid"]=t ),new Request.Contao({url:window.location.href,followRedirects:!1}).get(r),!1},t oggleFeatured:function(e,t){e.blur();var n=$(e).getFirst("img"),a=1==n.get("data -state");return null===n.get("data-state")&&(a=-1==n.src.indexOf("featured_"),wi ndow.console&&console.warn('Using a featured toggle without a "data-state" attri bute is deprecated. Please adjust your Contao DCA file.')),a?(n.src=AjaxRequest. themePath+"icons/featured_.svg",n.set("data-state",0),(new Request.Contao).post( {action:"toggleFeatured",id:t,state:0,REQUEST_TOKEN:Contao.request_token})):(n.s rc=AjaxRequest.themePath+"icons/featured.svg",n.set("data-state",1),(new Request .Contao).post({action:"toggleFeatured",id:t,state:1,REQUEST_TOKEN:Contao.request _token})),!1},toggleFieldset:function(e,t,n){e.blur(),Backend.getScrollOffset(); var a=$("pal_"+t);if(a.hasClass("collapsed"))a.removeClass("collapsed"),(new Req uest.Contao).post({action:"toggleFieldset",id:t,table:n,state:1,REQUEST_TOKEN:Co ntao.request_token});else{for(var o=a.getParent("form"),i=a.getElements("[requir ed]"),l=!0,s=0;s<i.length;s++)if(!i[s].get("value")){l=!1;break}l?(a.addClass("c ollapsed"),(new Request.Contao).post({action:"toggleFieldset",id:t,table:n,state :0,REQUEST_TOKEN:Contao.request_token})):"function"==typeof o.checkValidity&&o.g etElement('button[type="submit"]').click()}return!1},toggleCheckboxGroup:functio n(e,t){e.blur();var n=$(t),a=$(e).getFirst("img");return!!n&&("none"==n.getStyle ("display")?(n.setStyle("display",null),a.src=AjaxRequest.themePath+"icons/folMi nus.svg",(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:1,RE QUEST_TOKEN:Contao.request_token})):(n.setStyle("display","none"),a.src=AjaxRequ est.themePath+"icons/folPlus.svg",(new Request.Contao).post({action:"toggleCheck boxGroup",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!0)},displayBox:fun ction(e){var t=$("tl_ajaxBox"),n=$("tl_ajaxOverlay"),a=window.getScroll();null== =n&&(n=new Element("div",{id:"tl_ajaxOverlay"}).inject($(document.body),"bottom" )),n.set({styles:{display:"block",top:a.y+"px"}}),null===t&&(t=new Element("div" ,{id:"tl_ajaxBox"}).inject($(document.body),"bottom")),t.set({html:e,styles:{dis play:"block",top:a.y+100+"px"}})},hideBox:function(){var e=$("tl_ajaxBox"),t=$(" tl_ajaxOverlay");t&&t.setStyle("display","none"),e&&e.setStyle("display","none") }},Backend={currentId:null,xMousePosition:0,yMousePosition:0,popupWindow:null,th emePath:Contao.script_url+"system/themes/"+Contao.theme+"/",getMousePosition:fun ction(e){Backend.xMousePosition=e.client.x,Backend.yMousePosition=e.client.y},op enWindow:function(e,t,n){e.blur(),t=Browser.ie?t+40:t+17,n=Browser.ie?n+30:n+17, Backend.popupWindow=window.open(e.href,"","width="+t+",height="+n+",modal=yes,le ft=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,tool bar=no")},openModalWindow:function(e,t,n){new SimpleModal({width:e,hideFooter:!0 ,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overfl ow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).sh ow({title:t,contents:n})},openModalImage:function(e){var t=e||{},n=(window.getSi ze().x-20).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),new SimpleMo dal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function( ){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.s etStyle("overflow","auto")}}).show({title:t.title,contents:'<img src="'+t.url+'" alt="">'})},openModalIframe:function(e){var t=e||{},n=(window.getSize().x-20).t oInt(),a=(window.getSize().y-137).toInt();(!t.width||t.width>n)&&(t.width=Math.m in(n,900)),(!t.height||t.height>a)&&(t.height=a),new SimpleModal({width:t.width, hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.set Style("overflow","hidden")},onHide:function(){document.body.setStyle("overflow", "auto")}}).show({title:t.title,contents:'<iframe src="'+t.url+'" width="100%" he ight="'+t.height+'" frameborder="0"></iframe>'})},openModalSelector:function(e){ var d=e||{},t=(window.getSize().x-20).toInt(),n=(window.getSize().y-192).toInt() ;d.id||(d.id="tl_select"),(!d.width||d.width>t)&&(d.width=Math.min(t,900)),(!d.h eight||d.height>n)&&(d.height=n);var a=new SimpleModal({width:d.width,btn_ok:Con tao.lang.close,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.se tStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow" ,"auto")}});a.addButton(Contao.lang.close,"btn",function(){this.buttons[0].hasCl ass("btn-disabled")||this.hide()}),a.addButton(Contao.lang.apply,"btn primary",f unction(){if(!this.buttons[1].hasClass("btn-disabled")){var e,t,n,a,o,i,l,s,r=wi ndow.frames["simple-modal-iframe"],c=[];if(void 0!==r){for((l=(e=r.document.getE lementById(d.id)).get("data-picker-value"))&&(c=JSON.parse(l)),t=e.getElementsBy TagName("input"),i=0;i<t.length;i++)t[i].id.match(/^(check_all_|reset_)/)||(s=c. indexOf(t[i].get("value")),t[i].checked?-1==s&&c.push(t[i].get("value")):-1!=s&& c.splice(s,1));d.callback?d.callback(e.get("data-table"),c):d.tag&&(n=$(d.tag))? (window.console&&console.warn("Using the modal selector without a callback funct ion is deprecated. Please adjust your Contao DCA file."),n.value=c.join(","),(o= e.get("data-inserttag"))&&(n.value="{{"+o+"::"+n.value+"}}"),d.self.set("href",d .self.get("href").replace(/&value=[^&]*/,"&value="+c.join(",")))):d.id&&(n=$("ct rl_"+d.id))&&(a=e.get("data-callback"))&&(window.console&&console.warn("Using th e modal selector without a callback function is deprecated. Please adjust your C ontao DCA file."),n.value=c.join("\t"),new Request.Contao({field:n,evalScripts:! 1,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function( e,t){$("ctrl_"+d.id).getParent("div").set("html",t.content),t.javascript&&Browse r.exec(t.javascript),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).po st({action:a,name:d.id,value:n.value,REQUEST_TOKEN:Contao.request_token})),this. hide()}else alert("Could not find the SimpleModal frame")}}),a.show({title:d.tit le,contents:'<iframe src="'+d.url+'" name="simple-modal-iframe" width="100%" hei ght="'+d.height+'" frameborder="0"></iframe>',model:"modal"})},openModalBrowser: function(n,e,t,a,o){Backend.openModalSelector({id:"tl_listing",title:a.document. getElement("div.mce-title").get("text"),url:Contao.routes.backend_picker+"?conte xt="+("file"==t?"link":"file")+"&amp;extras[fieldType]=radio&amp;extras[filesOnl y]=true&amp;extras[source]="+o+"&amp;value="+e+"&amp;popup=1",callback:function( e,t){a.document.getElementById(n).value=t.join(",")}})},getScrollOffset:function (){window.sessionStorage.setItem("contao_backend_offset",window.getScroll().y)}, initScrollOffset:function(){Cookie.dispose("BE_PAGE_OFFSET"),$$('.tl_submit_cont ainer button[name][name!="save"]').each(function(e){e.addEvent("click",function( ){window.sessionStorage.removeItem("contao_backend_offset")})});var e=window.ses sionStorage.getItem("contao_backend_offset");if(window.sessionStorage.removeItem ("contao_backend_offset"),e){var t=window.document.getElementById("header"),i=0; t&&t.addClass("down"),$$("[data-add-to-scroll-offset]").each(function(e){var t=e .get("data-add-to-scroll-offset"),n=e.getScrollSize().y,a=!1,o=!1;t?("-"===t.cha rAt(0)&&(a=!0,t=t.substring(1)),"%"===t.charAt(t.length-1)&&(o=!0,t=t.substring( 0,t.length-1)),t=parseInt(t,10),o&&(t=Math.round(n*t/100)),a&&(t*=-1),i+=t):i+=n }),this.vScrollTo(parseInt(e,10)+i)}},autoSubmit:function(e){Backend.getScrollOf fset();var t=new Element("input",{type:"hidden",name:"SUBMIT_TYPE",value:"auto"} ),n=$(e)||e;t.inject(n,"bottom"),n.submit()},vScrollTo:function(e){window.addEve nt("load",function(){window.scrollTo(null,parseInt(e))})},limitPreviewHeight:fun ction(){var l=0;$$("div.limit_height").each(function(e){var t,n,a,o,i=e.getParen t(".tl_content");i&&(i.hasClass("wrapper_start")||i.hasClass("wrapper_stop"))||( 0===l&&(l=e.className.replace(/[^0-9]*/,"").toInt()),l&&(t=new Element("div",{cl ass:"limit_toggler"}),n=new Element("button",{type:"button",html:"<span>...</spa n>",class:"unselectable","data-state":0}).inject(t),a=e.getCoordinates(),e.setSt yle("height",l),a.height<=l||(n.addEvent("click",function(){o=t.getPrevious("div ").getStyle("height").toInt(),t.getPrevious("div").setStyle("height",l<o?l:""),n .set("data-state",n.get("data-state")?0:1)}),t.inject(e,"after"))))})},toggleChe ckboxes:function(e,t){for(var n=$$("input"),a=$(e).checked?"checked":"",o=0;o<n. length;o++)"checkbox"==n[o].type.toLowerCase()&&(void 0!==t&&t!=n[o].id.substr(0 ,t.length)||(n[o].checked=a))},toggleCheckboxGroup:function(e,t){var n=$(e).clas sName,a=$(e).checked?"checked":"";"tl_checkbox"==n?($(t)?$$("#"+t+" .tl_checkbox "):$(e).getParent("fieldset").getElements(".tl_checkbox")).each(function(e){e.ch ecked=a}):"tl_tree_checkbox"==n&&$$("#"+t+" .parent .tl_tree_checkbox").each(fun ction(e){e.checked=a});Backend.getScrollOffset()},toggleCheckboxElements:functio n(e,t){var n=$(e).checked?"checked":"";$$("."+t).each(function(e){e.hasClass("tl _checkbox")&&(e.checked=n)}),Backend.getScrollOffset()},toggleWrap:function(e){v ar t=$(e),n="off"==t.getProperty("wrap")?"soft":"off";t.setProperty("wrap",n)},t oggleUnchanged:function(){$$("#result-list .tl_confirm").each(function(e){e.togg leClass("hidden")})},blink:function(){},addColorPicker:function(){return!0},coll apsePalettes:function(){$$("fieldset.hide").each(function(e){e.addClass("collaps ed")}),$$("label.error, label.mandatory").each(function(e){var t=e.getParent("fi eldset");t&&t.removeClass("collapsed")})},addInteractiveHelp:function(){new Tips .Contao("p.tl_tip",{offset:{x:9,y:23},text:function(e){return e.get("html")}}),n ew Tips.Contao($("home"),{offset:{x:15,y:42}}),new Tips.Contao($$("#tmenu a[titl e]").filter(function(e){return""!=e.title}),{offset:{x:9,y:42}}),new Tips.Contao ($$('a[title][class^="group-"]').filter(function(e){return""!=e.title}),{offset: {x:3,y:27}}),new Tips.Contao($$("a[title].navigation").filter(function(e){return ""!=e.title}),{offset:{x:34,y:32}}),$$("img[title]").filter(function(e){return"" !=e.title}).each(function(e){new Tips.Contao(e,{offset:{x:0,y:"gimage"==e.get("c lass")?60:30}})}),["a[title]","input[title]","button[title]","time[title]"].each (function(e){new Tips.Contao($$(e).filter(function(e){return""!=e.title}),{offse t:{x:0,y:"time[title]"==e?26:30}})})},makeParentViewSortable:function(e){var t=n ew Scroller(document.getElement("body"),{onChange:function(e,t){this.element.scr ollTo(this.element.getScroll().x,t)}}),i=new Sortables(e,{constrain:!0,opacity:. 6,onStart:function(){t.start()},onComplete:function(){t.stop()},onSort:function( e){var t,n,a=e.getParent("ul"),o=0;if(a&&(t=a.getChildren("li > div:first-child" )))for(n=0;n<t.length;n++)t[n].hasClass("wrapper_stop")&&0<o&&o--,t[n].className =t[n].className.replace(/(^|\s)indent[^\s]*/g,""),0<o&&t[n].addClass("indent").a ddClass("indent_"+o),t[n].hasClass("wrapper_start")&&o++,t[n].removeClass("inden t_first"),t[n].removeClass("indent_last"),t[n-1]&&t[n-1].hasClass("wrapper_start ")&&t[n].addClass("indent_first"),t[n+1]&&t[n+1].hasClass("wrapper_stop")&&t[n]. addClass("indent_last")},handle:".drag-handle"});i.active=!1,i.addEvent("start", function(){i.active=!0}),i.addEvent("complete",function(e){var t,n,a,o;i.active& &(e.getPrevious("li")?(t=e.get("id").replace(/li_/,""),n=e.getPrevious("li").get ("id").replace(/li_/,""),a=window.location.search.replace(/id=[0-9]*/,"id="+t)+" &act=cut&mode=1&pid="+n,o=window.location.href.replace(/\?.*$/,""),new Request.C ontao({url:o+a,followRedirects:!1}).get()):e.getParent("ul")&&(t=e.get("id").rep lace(/li_/,""),n=e.getParent("ul").get("id").replace(/ul_/,""),a=window.location .search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&mode=2&pid="+n,o=window.location. href.replace(/\?.*$/,""),new Request.Contao({url:o+a,followRedirects:!1}).get()) )})},makeMultiSrcSortable:function(a,o,i){var e=new Sortables($(a),{constrain:!0 ,opacity:.6}).addEvent("complete",function(){var e,t=[],n=$(a).getChildren("li") ;for(e=0;e<n.length;e++)t.push(n[e].get("data-id"));$(o).value=t.join(",")});$(a ).getElements(".gimage").each(function(n){n.hasClass("removable")?new Element("b utton",{type:"button",html:"&times;",class:"tl_red"}).addEvent("click",function( ){var e=n.getParent("li"),t=e.get("data-id");$(i).value=$(i).value.split(",").fi lter(function(e){return e!=t}).join(","),$(o).value=$(o).value.split(",").filter (function(e){return e!=t}).join(","),e.dispose()}).inject(n,"after"):new Element ("button",{type:"button",html:"&times",disabled:!0}).inject(n,"after")}),e.fireE vent("complete")},enableFileTreeDragAndDrop:function(c,d){var u=new Scroller(doc ument.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this.elem ent.getScroll().x,t)}});function g(e){return e&&e.hasClass("parent")&&e.getPrevi ous(".tl_folder")?e.getPrevious(".tl_folder"):e}c.addEvent("mousedown",function( e){var t=e.target.hasClass("drag-handle")?e.target:e.target.getParent(".drag-han dle"),o=e.target.getParent(".tl_file,.tl_folder");if(t&&o&&!e.rightClick){u.star t(),c.addClass("tl_listing_dragging");var i,l,n=o.getElements(".tl_left")[0]||o, s=n.clone(!0).inject(c).addClass("tl_left_dragging");s.setPosition({x:e.page.x-n .getOffsetParent().getPosition().x-s.getSize().x,y:n.getPosition(n.getOffsetPare nt()).y}).setStyle("display","none");var a=new Drag.Move(s,{droppables:$$([c]).a ppend(c.getElements(".tl_folder,li.parent,.tl_folder_top")),unDraggableTags:[],m odifiers:{x:"left",y:"top"},onStart:function(){s.setStyle("display","")},onEnter :function(e,t){if((t=g(t)).addClass("tl_folder_dropping"),t.hasClass("tl_folder" )&&i!==t){i=t,l=(new Date).getTime();var n=t.getElement('img[src$="/icons/folPlu s.svg"]');(n=n&&n.getParent("a"))&&setTimeout(function(){if(i===t&&l+900<(new Da te).getTime()){var e=document.createEvent("HTMLEvents");e.initEvent("click",!0,! 0),n.dispatchEvent(e),l=i=void 0,window.addEvent("ajax_change",function e(){a&&a .droppables&&c&&c.getElements&&(a.droppables=$$([c]).append(c.getElements(".tl_f older,li.parent"))),window.removeEvent("ajax_change",e)})}},1e3)}},onCancel:func tion(){l=i=void 0,u.stop(),s.destroy(),window.removeEvent("keyup",r),c.getElemen ts(".tl_folder_dropping").removeClass("tl_folder_dropping"),c.removeClass("tl_li sting_dragging")},onDrop:function(e,t){if(l=i=void 0,u.stop(),s.destroy(),window .removeEvent("keyup",r),c.getElements(".tl_folder_dropping").removeClass("tl_fol der_dropping"),c.removeClass("tl_listing_dragging"),t=g(t)){var n=o.get("data-id "),a=t.get("data-id")||decodeURIComponent(d.url.split(/[?&]pid=/)[1].split("&")[ 0]);n&&a&&(0===(a+"/").indexOf(n+"/")||a+"/"===n.replace(/[^/]+$/,""))||(Backend .getScrollOffset(),document.location.href=d.url+"&id="+encodeURIComponent(n)+"&p id="+encodeURIComponent(a))}},onLeave:function(e,t){(t=g(t)).removeClass("tl_fol der_dropping"),l=i=void 0}});a.start(e),window.addEvent("keyup",r)}function r(e) {"esc"===e.key&&a&&a.stop&&(a.droppables=$$([]),a.stop())}})},listWizard:functio n(e){var l=$(e),s=function(n){var e,a,o,i;n.getElements("button").each(function( t){if(!t.hasEvent("click"))switch(t.getProperty("data-command")){case"copy":t.ad dEvent("click",function(){Backend.getScrollOffset(),e=n.clone(!0).inject(n,"befo re"),(a=n.getFirst("input"))&&(e.getFirst("input").value=a.value),s(e)});break;c ase"delete":t.addEvent("click",function(){Backend.getScrollOffset(),1<l.getChild ren().length&&n.destroy()});break;case null:t.addEvent("keydown",function(e){38= =e.event.keyCode?(e.preventDefault(),(o=n.getPrevious("li"))?n.inject(o,"before" ):n.inject(l,"bottom"),t.focus()):40==e.event.keyCode&&(e.preventDefault(),(i=n. getNext("li"))?n.inject(i,"after"):n.inject(l.getFirst("li"),"before"),t.focus() )})}})};new Sortables(l,{constrain:!0,opacity:.6,handle:".drag-handle"}),l.getCh ildren().each(function(e){s(e)})},tableWizard:function(e){var t=$(e),d=t.getElem ent("thead"),u=t.getElement("tbody"),g=function(e){var t,n,a,o,i=e.getChildren() ;for(a=0;a<i.length;a++)for(n=i[a].getChildren(),o=0;o<n.length;o++)(t=n[o].getF irst("textarea"))&&(t.name=t.name.replace(/\[[0-9]+][[0-9]+]/g,"["+a+"]["+o+"]") );new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:func tion(){g(e)}})},f=function(n){var e,a,o,i,l,s,r,c=d.getFirst("tr");n.getElements ("button").each(function(t){if(!t.hasEvent("click"))switch(t.getProperty("data-c ommand")){case"rcopy":t.addEvent("click",function(){for(Backend.getScrollOffset( ),i=new Element("tr"),l=n.getChildren(),r=0;r<l.length;r++)o=l[r].clone(!0).inje ct(i,"bottom"),(e=l[r].getFirst("textarea"))&&(o.getFirst("textarea").value=e.va lue);i.inject(n,"after"),f(i),g(u)});break;case"rdelete":t.addEvent("click",func tion(){Backend.getScrollOffset(),1<u.getChildren().length&&n.destroy(),g(u)});br eak;case"ccopy":t.addEvent("click",function(){for(Backend.getScrollOffset(),s=h( t),l=u.getChildren(),r=0;r<l.length;r++)a=l[r].getChildren()[s],o=a.clone(!0).in ject(a,"after"),(e=a.getFirst("textarea"))&&(o.getFirst("textarea").value=e.valu e),f(o);o=c.getFirst("td").clone(!0).inject(c.getLast("td"),"before"),f(o),g(u)} );break;case"cmovel":t.addEvent("click",function(){if(Backend.getScrollOffset(), s=h(t),l=u.getChildren(),0<s)for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).in ject(a.getPrevious(),"before");else for(r=0;r<l.length;r++)(a=l[r].getChildren() [s]).inject(l[r].getLast(),"before");g(u)});break;case"cmover":t.addEvent("click ",function(){if(Backend.getScrollOffset(),s=h(t),l=u.getChildren(),s<n.getChildr en().length-2)for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).inject(a.getNext( ),"after");else for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).inject(l[r].get First(),"before");g(u)});break;case"cdelete":t.addEvent("click",function(){if(Ba ckend.getScrollOffset(),s=h(t),l=u.getChildren(),2<n.getChildren().length){for(r =0;r<l.length;r++)l[r].getChildren()[s].destroy();c.getFirst("td").destroy()}g(u )});break;case null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.prev entDefault(),(i=n.getPrevious("tr"))?n.inject(i,"before"):n.inject(u,"bottom"),t .focus(),g(u)):40==e.event.keyCode&&(e.preventDefault(),(i=n.getNext("tr"))?n.in ject(i,"after"):n.inject(u,"top"),t.focus(),g(u))})}})},h=function(e){var t,n=$( e).getParent("td"),a=n.getParent("tr").getChildren(),o=0;for(t=0;t<a.length&&a[t ]!=n;t++)o++;return o};g(u),d.getChildren().each(function(e){f(e)}),u.getChildre n().each(function(e){f(e)}),Backend.tableWizardResize()},tableWizardResize:funct ion(t){var n=window.localStorage.getItem("contao_table_wizard_cell_size");if(voi d 0!==t)n="",$$(".tl_tablewizard textarea").each(function(e){e.setStyle("width", (e.getStyle("width").toInt()*t).round().limit(142,284)),e.setStyle("height",(e.g etStyle("height").toInt()*t).round().limit(66,132)),""==n&&(n=e.getStyle("width" )+"|"+e.getStyle("height"))}),window.localStorage.setItem("contao_table_wizard_c ell_size",n);else if(null!==n){var a=n.split("|");$$(".tl_tablewizard textarea") .each(function(e){e.setStyle("width",a[0]),e.setStyle("height",a[1])})}},tableWi zardSetWidth:function(){var e=$("tl_tablewizard");e&&e.setStyle("width",Math.rou nd(.96*e.getParent(".tl_formbody_edit").getComputedSize().width))},moduleWizard: function(e){var r=$(e).getElement("tbody"),c=function(e){var t,n,a,o,i,l=e.getCh ildren();for(n=0;n<l.length;n++)for(t=l[n].getChildren(),a=0;a<t.length;a++)(o=t [a].getElement("select"))&&(o.name=o.name.replace(/\[[0-9]+]/g,"["+n+"]")),(i=t[ a].getElement('input[type="checkbox"]'))&&(i.set("tabindex",-1),i.name=i.name.re place(/\[[0-9]+]/g,"["+n+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:" .drag-handle",onComplete:function(){c(e)}})},d=function(n){var e,a,o,i,l,s;n.get Elements("button").each(function(t){if(!t.hasEvent("click"))switch(t.getProperty ("data-command")){case"copy":t.addEvent("click",function(){for(Backend.getScroll Offset(),o=new Element("tr"),i=n.getChildren(),s=0;s<i.length;s++)a=i[s].clone(! 0).inject(o,"bottom"),(e=i[s].getElement("select"))&&(a.getElement("select").val ue=e.value);o.inject(n,"after"),o.getElement(".chzn-container").destroy(),new Ch osen(o.getElement("select.tl_select")),d(o),c(r)});break;case"delete":t.addEvent ("click",function(){Backend.getScrollOffset(),1<r.getChildren().length&&n.destro y(),c(r)});break;case"enable":t.addEvent("click",function(){Backend.getScrollOff set(),(l=t.getNext('input[type="checkbox"]')).checked?(l.checked="",t.getElement ("img").src=Backend.themePath+"icons/invisible.svg"):(l.checked="checked",t.getE lement("img").src=Backend.themePath+"icons/visible.svg"),c(r)});break;case null: t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefault(),(o=n.ge tPrevious("tr"))?n.inject(o,"before"):n.inject(r,"bottom"),t.focus(),c(r)):40==e .event.keyCode&&(e.preventDefault(),(o=n.getNext("tr"))?n.inject(o,"after"):n.in ject(r,"top"),t.focus(),c(r))})}})};c(r),r.getChildren().each(function(e){d(e)}) },optionsWizard:function(e){var s=$(e).getElement("tbody"),r=function(e){var t,n ,a,o,i=e.getChildren();for(n=0;n<i.length;n++)for(t=i[n].getChildren(),a=0;a<t.l ength;a++)(o=t[a].getFirst("input"))&&(o.name=o.name.replace(/\[[0-9]+]/g,"["+n+ "]"),"checkbox"==o.type&&(o.id=o.name.replace(/\[[0-9]+]/g,"").replace(/\[/g,"_" ).replace(/]/g,"")+"_"+n,o.getNext("label").set("for",o.id)));new Sortables(e,{c onstrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){r(e)}})},c=fu nction(n){var e,a,o,i,l;n.getElements("button").each(function(t){if(!t.hasEvent( "click"))switch(t.getProperty("data-command")){case"copy":t.addEvent("click",fun ction(){for(Backend.getScrollOffset(),o=new Element("tr"),i=n.getChildren(),l=0; l<i.length;l++)a=i[l].clone(!0).inject(o,"bottom"),(e=i[l].getFirst("input"))&&( a.getFirst("input").value=e.value,"checkbox"==e.type&&(a.getFirst("input").check ed=e.checked?"checked":""));o.inject(n,"after"),c(o),r(s)});break;case"delete":t .addEvent("click",function(){Backend.getScrollOffset(),1<s.getChildren().length& &n.destroy(),r(s)});break;case null:t.addEvent("keydown",function(e){38==e.event .keyCode?(e.preventDefault(),(o=n.getPrevious("tr"))?n.inject(o,"before"):n.inje ct(s,"bottom"),t.focus(),r(s)):40==e.event.keyCode&&(e.preventDefault(),(o=n.get Next("tr"))?n.inject(o,"after"):n.inject(s,"top"),t.focus(),r(s))})}})};r(s),s.g etChildren().each(function(e){c(e)})},keyValueWizard:function(e){var s=$(e).getE lement("tbody"),r=function(e){var t,n,a,o,i=e.getChildren();for(n=0;n<i.length;n ++)for(t=i[n].getChildren(),a=0;a<t.length;a++)(o=t[a].getFirst("input"))&&(o.na me=o.name.replace(/\[[0-9]+]/g,"["+n+"]"));new Sortables(e,{constrain:!0,opacity :.6,handle:".drag-handle",onComplete:function(){r(e)}})},c=function(n){var e,a,o ,i,l;n.getElements("button").each(function(t){if(!t.hasEvent("click"))switch(t.g etProperty("data-command")){case"copy":t.addEvent("click",function(){for(Backend .getScrollOffset(),o=new Element("tr"),i=n.getChildren(),l=0;l<i.length;l++)a=i[ l].clone(!0).inject(o,"bottom"),(e=i[l].getFirst("input"))&&(a.getFirst().value= e.value);o.inject(n,"after"),c(o),r(s)});break;case"delete":t.addEvent("click",f unction(){Backend.getScrollOffset(),1<s.getChildren().length&&n.destroy(),r(s)}) ;break;case null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.prevent Default(),(o=n.getPrevious("tr"))?n.inject(o,"before"):n.inject(s,"bottom"),t.fo cus(),r(s)):40==e.event.keyCode&&(e.preventDefault(),(o=n.getNext("tr"))?n.injec t(o,"after"):n.inject(s,"top"),t.focus(),r(s))})}})};r(s),s.getChildren().each(f unction(e){c(e)})},checkboxWizard:function(e){var o=$(e).getElement(".sortable") ;new Sortables(o,{constrain:!0,opacity:.6,handle:".drag-handle"}),o.getChildren( ).each(function(e){var n,a;(n=e).getElements("button").each(function(t){t.hasEve nt("click")||t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefa ult(),(a=n.getPrevious("span"))?n.inject(a,"before"):n.inject(o,"bottom"),t.focu s()):40==e.event.keyCode&&(e.preventDefault(),(a=n.getNext("span"))?n.inject(a," after"):n.inject(o,"top"),t.focus())})})})},metaDelete:function(e){var t=e.getPa rent("li");null===t.getPrevious()&&null===t.getNext()?t.getElements("input").eac h(function(e){e.value=""}):t.destroy()},toggleAddLanguageButton:function(e){var t=e.getParent("div").getElement('input[type="button"]');""!=e.value?t.removeProp erty("disabled"):t.setProperty("disabled",!0)},sectionWizard:function(e){var c=$ (e).getElement("tbody"),d=function(e){var t,n,a,o=e.getChildren();for(n=0;n<o.le ngth;n++)for(t=o[n].getChildren(),a=0;a<t.length;a++)t[a].getElements("input").e ach(function(e){e.name=e.name.replace(/\[[0-9]+]/g,"["+n+"]")}),t[a].getElements ("select").each(function(e){e.name=e.name.replace(/\[[0-9]+]/g,"["+n+"]")});new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function() {d(e)}})},u=function(n){var e,a,o,i,l,s,r;n.getElements("button").each(function( t){if(!t.hasEvent("click"))switch(t.getProperty("data-command")){case"copy":t.ad dEvent("click",function(){for(Backend.getScrollOffset(),a=new Element("tr"),o=n. getChildren(),s=0;s<o.length;s++)for(e=o[s].clone(!0).inject(a,"bottom"),i=o[s]. getElements("select"),l=e.getElements("select"),r=0;r<i.length;r++)l[r].value=i[ r].value;a.inject(n,"after"),u(a),d(c)});break;case"delete":t.addEvent("click",f unction(){Backend.getScrollOffset(),1<c.getChildren().length&&n.destroy(),d(c)}) ;break;case null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.prevent Default(),(a=n.getPrevious("tr"))?n.inject(a,"before"):n.inject(c,"bottom"),t.fo cus(),d(c)):40==e.event.keyCode&&(e.preventDefault(),(a=n.getNext("tr"))?n.injec t(a,"after"):n.inject(c,"top"),t.focus(),d(c))})}})};d(c),c.getChildren().each(f unction(e){u(e)})},updateModuleLink:function(e){var t=e.getParent("tr").getLast( "td"),n=t.getElement("a.module_link");n.href=n.href.replace(/id=[0-9]+/,"id="+e. value),0<e.value?(t.getElement("a.module_link").setStyle("display",null),t.getEl ement("img.module_image").setStyle("display","none")):(t.getElement("a.module_li nk").setStyle("display","none"),t.getElement("img.module_image").setStyle("displ ay",null))},enableImageSizeWidgets:function(){$$(".tl_image_size").each(function (e){function t(){if(""===n.get("value")||0===n.get("value").indexOf("_")||n.get( "value").toInt().toString()===n.get("value")){a.readOnly=!0,o.readOnly=!0;var e= $(n.getSelected()[0]).get("text");e=1<e.split("(").length?e.split("(").getLast() .split(")")[0].split("x"):["",""],a.set("value","").set("placeholder",+e[0]||"") ,o.set("value","").set("placeholder",+e[1]||"")}else a.set("placeholder",""),o.s et("placeholder",""),a.readOnly=!1,o.readOnly=!1}var n=e.getElement("select"),a= e.getChildren("input")[0],o=e.getChildren("input")[1];t(),n.addEvent("change",t) ,n.addEvent("keyup",t)})},enableToggleSelect:function(){function a(e){for(t=r.in dexOf(e),n=r.indexOf(o),l=Math.min(t,n),s=Math.max(t,n),i=!!r[n].checked;l<=s;l+ +)r[l].checked=i}var o,t,n,i,l,s,e=$("tl_listing"),r=[];e&&(r=e.getElements('inp ut[type="checkbox"]')),$$(".toggle_select").each(function(e){var t=e.retrieve("b oundEvent");t&&e.removeEvent("click",t),e.getElements('label,input[type="checkbo x"],input[type="radio"]').each(function(e){e.addEvent("click",function(e){e.stop Propagation()})}),t=function(e){var t=this.getElement('input[type="checkbox"],in put[type="radio"]'),n=$(e.target).getParent(".limit_toggler");t&&!t.get("disable d")&&null===n&&("radio"!=t.type?(e.shift&&o?a(t):(t.checked=t.checked?"":"checke d","Backend.toggleCheckboxes(this)"==t.get("onclick")&&Backend.toggleCheckboxes( t)),o=t):t.checked||(t.checked="checked"))}.bind(e),e.addEvent("click",t),e.stor e("boundEvent",t)}),r.each(function(e){e.addEvent("click",function(e){e.shift&&o &&a(this),o=this})})},autoFocusFirstInputField:function(){var e=document.id("mai n").getElement(".tl_formbody_edit");if(e){var t=e.getElements("input, textarea") .filter(function(e){return!e.get("disabled")&&e.isVisible()&&"checkbox"!==e.get( "type")&&"radio"!==e.get("type")&&"submit"!==e.get("type")&&"image"!==e.get("typ e")});t[0]&&t[0].focus()}},editPreviewWizard:function(s){function r(){return{x:u .getComputedSize().width,y:u.getComputedSize().height}}function e(){var e=r(),t= u.getComputedSize();c.setStyles({top:t.computedTop+(g.y.get("value")*e.y).round( )+"px",left:t.computedLeft+(g.x.get("value")*e.x).round()+"px",width:(g.width.ge t("value")*e.x).round()+"px",height:(g.height.get("value")*e.y).round()+"px"}),g .width.get("value").toFloat()&&g.height.get("value").toFloat()?c.setStyle("displ ay",null):c.setStyle("display","none")}function t(e){e.preventDefault(),f||(f=!0 ,d={x:e.page.x-s.getPosition().x-u.getComputedSize().computedLeft,y:e.page.y-s.g etPosition().y-u.getComputedSize().computedTop},a(e))}function n(e){a(e),f=!1}va r c,d,u=(s=$(s)).getElement("img"),g={},f=!1,a=function(e){if(f){e.preventDefaul t();var t,n,a,o,i=u.getComputedSize(),l={x:[Math.max(0,Math.min(i.width,d.x)),Ma th.max(0,Math.min(i.width,e.page.x-s.getPosition().x-i.computedLeft))],y:[Math.m ax(0,Math.min(i.height,d.y)),Math.max(0,Math.min(i.height,e.page.y-s.getPosition ().y-i.computedTop))]};c.setStyles({top:Math.min(l.y[0],l.y[1])+i.computedTop+"p x",left:Math.min(l.x[0],l.x[1])+i.computedLeft+"px",width:Math.abs(l.x[0]-l.x[1] )+"px",height:Math.abs(l.y[0]-l.y[1])+"px"}),t=r(),n=c.getStyles("top","left","w idth","height"),a=u.getComputedSize(),(o={x:Math.max(0,Math.min(1,(n.left.toFloa t()-a.computedLeft)/t.x)),y:Math.max(0,Math.min(1,(n.top.toFloat()-a.computedTop )/t.y))}).width=Math.min(1-o.x,n.width.toFloat()/t.x),o.height=Math.min(1-o.y,n. height.toFloat()/t.y),o.width&&o.height?c.setStyle("display",null):(o.x=o.y=o.wi dth=o.height="",c.setStyle("display","none")),Object.each(o,function(e,t){g[t].s et("value",e)})}};window.addEvent("domready",function(){s.getParent(".tl_tbox,.t l_box").getElements('input[name^="importantPart"]').each(function(t){["x","y","w idth","height"].each(function(e){t.get("name").substr(13,e.length)===e.capitaliz e()&&(g[e]=t=$(t))})}),4===Object.getLength(g)&&(Object.each(g,function(e){e.get Parent().setStyle("display","none")}),s.addClass("tl_edit_preview_enabled"),c=ne w Element("div",{class:"tl_edit_preview_important_part"}).inject(s),e(),u.addEve nt("load",e),s.addEvents({mousedown:t,touchstart:t}),$(document.documentElement) .addEvents({mousemove:a,touchmove:a,mouseup:n,touchend:n,touchcancel:n,resize:e} ))})},enableFileTreeUpload:function(i,e){i=$(i);var l,s,r=e.url,t=new Element("d iv",{class:"dropzone dropzone-filetree",html:'<span class="dropzone-previews"></ span>'}).inject(i,"top");e.previewsContainer=t.getElement(".dropzone-previews"), e.clickable=!1;var c=new Dropzone(i,e);c.on("queuecomplete",function(){window.lo cation.reload()}),c.on("dragover",function(e){if(e.dataTransfer&&e.dataTransfer. types&&-1!==e.dataTransfer.types.indexOf("Files")){i.getElements(".tl_folder_dro pping").removeClass("tl_folder_dropping");var t=e.target&&$(e.target);if(t){var n=t.match(".tl_folder")?t:t.getParent(".tl_folder");if(n=n||(n=t.getParent(".par ent"))&&n.getPrevious(".tl_folder")){var a=n.getElement('img[src$="/icons/new.sv g"]');a=a&&a.getParent("a")}}if(a&&a.href){if(c.options.url=""+a.href,n.addClass ("tl_folder_dropping"),l!==n){l=n,s=(new Date).getTime();var o=n.getElement('img [src$="/icons/folPlus.svg"]');(o=o&&o.getParent("a"))&&setTimeout(function(){if( l===n&&s+900<(new Date).getTime()){var e=document.createEvent("HTMLEvents");e.in itEvent("click",!0,!0),o.dispatchEvent(e),s=l=void 0}},1e3)}}else c.options.url= r,s=l=void 0}}),c.on("drop",function(e){e.dataTransfer&&e.dataTransfer.types&&-1 !==e.dataTransfer.types.indexOf("Files")&&(t.addClass("dropzone-filetree-enabled "),Backend.getScrollOffset())}),c.on("dragleave",function(){i.getElements(".tl_f older_dropping").removeClass("tl_folder_dropping"),s=l=void 0})},crawl:function( ){var a=2e3,e=$("tl_crawl"),c=e.getElement("div.progress-bar"),d=e.getElement("p .progress-count"),u=e.getElement("div.results");!function n(){new Request({url:w indow.location.href,onSuccess:function(e){var t=JSON.decode(e);!function(e){var t,n=e.total-e.pending,a=0<e.total?parseInt(n/e.total*100,10):100;if(c.setStyle(" width",a+"%"),c.set("html",a+"%"),c.setAttribute("aria-valuenow",a),d.set("html" ,n+" / "+e.total),e.finished)for(t in c.removeClass("running").addClass("finishe d"),u.removeClass("running").addClass("finished"),e.results)if(e.results.hasOwnP roperty(t)){var o=u.getElement('.result[data-subscriber="'+t+'"] p.summary'),i=u .getElement('.result[data-subscriber="'+t+'"] p.warning'),l=u.getElement('.resul t[data-subscriber="'+t+'"] p.subscriber-log'),s=e.results[t],r=s.summary;s.warni ng&&i.set("html",s.warning),s.hasLog&&l.setStyle("display","block"),o.addClass(s .wasSuccessful?"success":"failure"),o.set("html",r)}}(t),t.finished||setTimeout( n,a)}}).send()}()}};document.addEvent("mousedown",function(e){Backend.getMousePo sition(e)}),window.addEvent("domready",function(){$(document.body).addClass("js" ),Browser.Features.Touch&&$(document.body).addClass("touch"),Backend.collapsePal ettes(),Backend.addInteractiveHelp(),Backend.tableWizardSetWidth(),Backend.enabl eImageSizeWidgets(),Backend.enableToggleSelect(),Backend.autoFocusFirstInputFiel d(),null!=Elements.chosen&&$$("select.tl_chosen").chosen(),$$("textarea.monospac e").each(function(e){Backend.toggleWrap(e)})}),window.addEvent("resize",function (){Backend.tableWizardSetWidth()}),window.addEvent("load",function(){Backend.lim itPreviewHeight()}),window.addEvent("ajax_change",function(){Backend.addInteract iveHelp(),Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=El ements.chosen&&$$("select.tl_chosen").filter(function(e){return"none"!=e.getStyl e("display")}).chosen()}); var AjaxRequest={themePath:Contao.script_url+"system/themes/"+Contao.theme+"/",t oggleNavigation:function(e,t,n){e.blur();var a=$(t),o=$(e).getParent("li");retur n a&&(o.hasClass("collapsed")?(o.removeClass("collapsed"),$(e).store("tip:title" ,Contao.lang.collapse),new Request.Contao({url:n}).post({action:"toggleNavigatio n",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(o.addClass("collapsed"),$ (e).store("tip:title",Contao.lang.expand),new Request.Contao({url:n}).post({acti on:"toggleNavigation",id:t,state:0,REQUEST_TOKEN:Contao.request_token}))),!1},to ggleStructure:function(i,l,s,r){i.blur();var e=$(l),c=$(i).getFirst("img");retur n e?"none"==e.getStyle("display")?(e.setStyle("display",null),c.src=AjaxRequest. themePath+"icons/folMinus.svg",$(i).store("tip:title",Contao.lang.collapse),new Request.Contao({field:i}).post({action:"toggleStructure",id:l,state:1,REQUEST_TO KEN:Contao.request_token})):(e.setStyle("display","none"),c.src=AjaxRequest.them ePath+"icons/folPlus.svg",$(i).store("tip:title",Contao.lang.expand),new Request .Contao({field:i}).post({action:"toggleStructure",id:l,state:0,REQUEST_TOKEN:Con tao.request_token})):new Request.Contao({field:i,evalScripts:!0,onRequest:AjaxRe quest.displayBox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new Eleme nt("li",{id:l,class:"parent",styles:{display:"inline"}});if(new Element("ul",{cl ass:"level_"+s,html:e}).inject(t,"bottom"),5==r)t.inject($(i).getParent("li"),"a fter");else{for(var n,a=!1,o=$(i).getParent("li");"element"==typeOf(o)&&(n=o.get Next("li"));)if((o=n).hasClass("tl_folder")){a=!0;break}a?t.inject(o,"before"):t .inject(o,"after")}t.getElements("a").each(function(e){e.href=e.href.replace(/&r ef=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(i).store("tip:title",Contao.lang.co llapse),c.src=AjaxRequest.themePath+"icons/folMinus.svg",window.fireEvent("struc ture"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"lo adStructure",id:l,level:s,state:1,REQUEST_TOKEN:Contao.request_token}),!1},toggl eFileManager:function(n,a,e,o){n.blur();var t=$(a),i=$(n).getFirst("img");return t?"none"==t.getStyle("display")?(t.setStyle("display",null),i.src=AjaxRequest.t hemePath+"icons/folMinus.svg",$(n).store("tip:title",Contao.lang.collapse),new R equest.Contao({field:n}).post({action:"toggleFileManager",id:a,state:1,REQUEST_T OKEN:Contao.request_token})):(t.setStyle("display","none"),i.src=AjaxRequest.the mePath+"icons/folPlus.svg",$(n).store("tip:title",Contao.lang.expand),new Reques t.Contao({field:n}).post({action:"toggleFileManager",id:a,state:0,REQUEST_TOKEN: Contao.request_token})):new Request.Contao({field:n,evalScripts:!0,onRequest:Aja xRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new El ement("li",{id:a,class:"parent",styles:{display:"inline"}});new Element("ul",{cl ass:"level_"+o,html:e}).inject(t,"bottom"),t.inject($(n).getParent("li"),"after" ),t.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&r ef="+Contao.referer_id)}),$(n).store("tip:title",Contao.lang.collapse),i.src=Aja xRequest.themePath+"icons/folMinus.svg",AjaxRequest.hideBox(),window.fireEvent(" ajax_change")}}).post({action:"loadFileManager",id:a,level:o,folder:e,state:1,RE QUEST_TOKEN:Contao.request_token}),!1},togglePagetree:function(n,a,e,t,o){n.blur (),Backend.getScrollOffset();var i=$(a),l=$(n).getFirst("img");return i?"none"== i.getStyle("display")?(i.setStyle("display",null),l.src=AjaxRequest.themePath+"i cons/folMinus.svg",$(n).store("tip:title",Contao.lang.collapse),new Request.Cont ao({field:n}).post({action:"togglePagetree",id:a,state:1,REQUEST_TOKEN:Contao.re quest_token})):(i.setStyle("display","none"),l.src=AjaxRequest.themePath+"icons/ folPlus.svg",$(n).store("tip:title",Contao.lang.expand),new Request.Contao({fiel d:n}).post({action:"togglePagetree",id:a,state:0,REQUEST_TOKEN:Contao.request_to ken})):new Request.Contao({field:n,evalScripts:!0,onRequest:AjaxRequest.displayB ox(Contao.lang.loading+" …"),onSuccess:function(e){var t=new Element("li",{id:a, class:"parent",styles:{display:"inline"}});new Element("ul",{class:"level_"+o,ht ml:e}).inject(t,"bottom"),t.inject($(n).getParent("li"),"after"),t.getElements(" a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.refer er_id)}),$(n).store("tip:title",Contao.lang.collapse),l.src=AjaxRequest.themePat h+"icons/folMinus.svg",AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}). post({action:"loadPagetree",id:a,level:o,field:e,name:t,state:1,REQUEST_TOKEN:Co ntao.request_token}),!1},toggleFiletree:function(n,a,e,t,o,i){n.blur(),Backend.g etScrollOffset();var l=$(a),s=$(n).getFirst("img");return l?"none"==l.getStyle(" display")?(l.setStyle("display",null),s.src=AjaxRequest.themePath+"icons/folMinu s.svg",$(n).store("tip:title",Contao.lang.collapse),new Request.Contao({field:n} ).post({action:"toggleFiletree",id:a,state:1,REQUEST_TOKEN:Contao.request_token} )):(l.setStyle("display","none"),s.src=AjaxRequest.themePath+"icons/folPlus.svg" ,$(n).store("tip:title",Contao.lang.expand),new Request.Contao({field:n}).post({ action:"toggleFiletree",id:a,state:0,REQUEST_TOKEN:Contao.request_token})):new R equest.Contao({field:n,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.la ng.loading+" …"),onSuccess:function(e){var t=new Element("li",{id:a,class:"paren t",styles:{display:"inline"}});new Element("ul",{class:"level_"+i,html:e}).injec t(t,"bottom"),t.inject($(n).getParent("li"),"after"),t.getElements("a").each(fun ction(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(n ).store("tip:title",Contao.lang.collapse),s.src=AjaxRequest.themePath+"icons/fol Minus.svg",AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action :"loadFiletree",id:a,folder:e,level:i,field:t,name:o,state:1,REQUEST_TOKEN:Conta o.request_token}),!1},toggleSubpalette:function(a,o,e){a.blur();var t=$(o);t?a.v alue?(a.value="",a.checked="",t.setStyle("display","none"),t.getElements("[requi red]").each(function(e){e.set("required",null).set("data-required","")}),new Req uest.Contao({field:a}).post({action:"toggleSubpalette",id:o,field:e,state:0,REQU EST_TOKEN:Contao.request_token})):(a.value=1,a.checked="checked",t.setStyle("dis play",null),t.getElements("[data-required]").each(function(e){e.set("required"," ").set("data-required",null)}),new Request.Contao({field:a}).post({action:"toggl eSubpalette",id:o,field:e,state:1,REQUEST_TOKEN:Contao.request_token})):new Requ est.Contao({field:a,evalScripts:!1,onRequest:AjaxRequest.displayBox(Contao.lang. loading+" …"),onSuccess:function(e,t){var n=new Element("div",{id:o,class:"subpa l cf",html:e,styles:{display:"block"}}).inject($(a).getParent("div").getParent(" div"),"after");t.javascript&&(document.write=function(e){var n="";e.replace(/<sc ript src="([^"]+)"/i,function(e,t){n=t}),n&&Asset.javascript(n,{onLoad:function( ){Browser.exec(t.javascript)}})},Browser.exec(t.javascript)),a.value=1,a.checked ="checked",n.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0 -9]+/,"&ref="+Contao.referer_id)}),AjaxRequest.hideBox(),window.fireEvent("subpa lette"),window.fireEvent("ajax_change")}}).post({action:"toggleSubpalette",id:o, field:e,load:1,state:1,REQUEST_TOKEN:Contao.request_token})},toggleVisibility:fu nction(e,t,n){e.blur();var a,o,i,l,s,r,c=null,d=$(e).getFirst("img"),u=1==d.get( "data-state"),g=e.getParent("div");return null===d.get("data-state")&&(u=-1==d.s rc.indexOf("invisible"),window.console&&console.warn('Using a visibility toggle without a "data-state" attribute is deprecated. Please adjust your Contao DCA fi le.')),g.hasClass("tl_right")?c=g.getPrevious("div").getElement("img"):g.hasClas s("tl_listing_container")?(null===(c=e.getParent("td").getPrevious("td").getFirs t("div.list_icon"))&&(c=e.getParent("td").getPrevious("td").getElement("div.cte_ type")),null===c&&(c=e.getParent("tr").getFirst("td").getElement("div.list_icon_ new"))):(o=g.getNext("div"))&&(o.hasClass("cte_type")&&(c=o),null===c&&(c=o.getF irst("div.list_icon"))),null!==c&&("img"==c.nodeName.toLowerCase()?(c.getParent( "ul.tl_listing").hasClass("tl_tree_xtnd")?(i=c.get("data-icon"),l=c.get("data-ic on-disabled"),null===i&&(i=c.src.replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|sv g)$/,"$1/$2.$3"),window.console&&console.warn('Using a row icon without a "data- icon" attribute is deprecated. Please adjust your Contao DCA file.')),null===l&& (l=c.src.replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)$/,"$1/$2_.$3"),window .console&&console.warn('Using a row icon without a "data-icon-disabled" attribut e is deprecated. Please adjust your Contao DCA file.'))):((s=c.getParent("a"))&& -1==s.href.indexOf("contao/preview")&&(c=(o=s.getNext("a"))?o.getFirst("img"):ne w Element("img")),i=c.get("data-icon"),l=c.get("data-icon-disabled"),null===i&&( a=c.src.replace(/.*_([0-9])\.(gif|png|jpe?g|svg)/,"$1"),i=c.src.replace(/_[0-9]\ .(gif|png|jpe?g|svg)/,(1==a.toInt()?"":"_"+(a.toInt()-1))+".$1").split(/[\\/]/). pop(),window.console&&console.warn('Using a row icon without a "data-icon" attri bute is deprecated. Please adjust your Contao DCA file.')),null===l&&(a=c.src.re place(/.*_([0-9])\.(gif|png|jpe?g|svg)/,"$1"),l=c.src.replace(/(_[0-9])?\.(gif|p ng|jpe?g|svg)/,(a==c.src?"_1":"_"+(a.toInt()+1))+".$2").split(/[\\/]/).pop(),win dow.console&&console.warn('Using a row icon without a "data-icon-disabled" attri bute is deprecated. Please adjust your Contao DCA file.'))),-1==i.indexOf("/")&& (i=AjaxRequest.themePath+(i.match(/\.svg$/)?"icons/":"images/")+i),-1==l.indexOf ("/")&&(l=AjaxRequest.themePath+(l.match(/\.svg$/)?"icons/":"images/")+l),c.src= u?l:i):c.hasClass("cte_type")?u?(c.addClass("unpublished"),c.removeClass("publis hed")):(c.addClass("published"),c.removeClass("unpublished")):(i=c.get("data-ico n"),l=c.get("data-icon-disabled"),null===i&&(i=c.getStyle("background-image").re place(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)\);?$/,"$1/$2.$2"),window.console &&console.warn('Using a row icon without a "data-icon" attribute is deprecated. Please adjust your Contao DCA file.')),null===l&&(l=c.getStyle("background-image ").replace(/(.*)\/([a-z0-9]+)_?\.(gif|png|jpe?g|svg)\);?$/,"$1/$2_.$3"),window.c onsole&&console.warn('Using a row icon without a "data-icon-disabled" attribute is deprecated. Please adjust your Contao DCA file.')),-1==i.indexOf("/")&&(i=Aja xRequest.themePath+(i.match(/\.svg$/)?"icons/":"images/")+i),-1==l.indexOf("/")& &(l=AjaxRequest.themePath+(l.match(/\.svg$/)?"icons/":"images/")+l),c.setStyle(" background-image","url("+(u?l:i)+")"))),"tl_style"==n&&g.getParent("div").getEle ment("pre").toggleClass("disabled"),u?(d.src=AjaxRequest.themePath+"icons/invisi ble.svg",d.set("data-state",0),(r={state:0,rt:Contao.request_token})[$(e).get("d ata-tid")||"tid"]=t):(d.src=AjaxRequest.themePath+"icons/visible.svg",d.set("dat a-state",1),(r={state:1,rt:Contao.request_token})[$(e).get("data-tid")||"tid"]=t ),new Request.Contao({url:window.location.href,followRedirects:!1}).get(r),!1},t oggleFeatured:function(e,t){e.blur();var n=$(e).getFirst("img"),a=1==n.get("data -state");return null===n.get("data-state")&&(a=-1==n.src.indexOf("featured_"),wi ndow.console&&console.warn('Using a featured toggle without a "data-state" attri bute is deprecated. Please adjust your Contao DCA file.')),a?(n.src=AjaxRequest. themePath+"icons/featured_.svg",n.set("data-state",0),(new Request.Contao).post( {action:"toggleFeatured",id:t,state:0,REQUEST_TOKEN:Contao.request_token})):(n.s rc=AjaxRequest.themePath+"icons/featured.svg",n.set("data-state",1),(new Request .Contao).post({action:"toggleFeatured",id:t,state:1,REQUEST_TOKEN:Contao.request _token})),!1},toggleFieldset:function(e,t,n){e.blur(),Backend.getScrollOffset(); var a=$("pal_"+t);if(a.hasClass("collapsed"))a.removeClass("collapsed"),(new Req uest.Contao).post({action:"toggleFieldset",id:t,table:n,state:1,REQUEST_TOKEN:Co ntao.request_token});else{for(var o=a.getParent("form"),i=a.getElements("[requir ed]"),l=!0,s=0;s<i.length;s++)if(!i[s].get("value")){l=!1;break}l?(a.addClass("c ollapsed"),(new Request.Contao).post({action:"toggleFieldset",id:t,table:n,state :0,REQUEST_TOKEN:Contao.request_token})):"function"==typeof o.checkValidity&&o.g etElement('button[type="submit"]').click()}return!1},toggleCheckboxGroup:functio n(e,t){e.blur();var n=$(t),a=$(e).getFirst("img");return!!n&&("none"==n.getStyle ("display")?(n.setStyle("display",null),a.src=AjaxRequest.themePath+"icons/folMi nus.svg",(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:1,RE QUEST_TOKEN:Contao.request_token})):(n.setStyle("display","none"),a.src=AjaxRequ est.themePath+"icons/folPlus.svg",(new Request.Contao).post({action:"toggleCheck boxGroup",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!0)},displayBox:fun ction(e){var t=$("tl_ajaxBox"),n=$("tl_ajaxOverlay"),a=window.getScroll();null== =n&&(n=new Element("div",{id:"tl_ajaxOverlay"}).inject($(document.body),"bottom" )),n.set({styles:{display:"block",top:a.y+"px"}}),null===t&&(t=new Element("div" ,{id:"tl_ajaxBox"}).inject($(document.body),"bottom")),t.set({html:e,styles:{dis play:"block",top:a.y+100+"px"}})},hideBox:function(){var e=$("tl_ajaxBox"),t=$(" tl_ajaxOverlay");t&&t.setStyle("display","none"),e&&e.setStyle("display","none") }},Backend={currentId:null,xMousePosition:0,yMousePosition:0,popupWindow:null,th emePath:Contao.script_url+"system/themes/"+Contao.theme+"/",getMousePosition:fun ction(e){Backend.xMousePosition=e.client.x,Backend.yMousePosition=e.client.y},op enWindow:function(e,t,n){e.blur(),t=Browser.ie?t+40:t+17,n=Browser.ie?n+30:n+17, Backend.popupWindow=window.open(e.href,"","width="+t+",height="+n+",modal=yes,le ft=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,tool bar=no")},openModalWindow:function(e,t,n){new SimpleModal({width:e,hideFooter:!0 ,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overfl ow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).sh ow({title:t,contents:n})},openModalImage:function(e){var t=e||{},n=(window.getSi ze().x-20).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),new SimpleMo dal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function( ){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.s etStyle("overflow","auto")}}).show({title:t.title,contents:'<img src="'+t.url+'" alt="">'})},openModalIframe:function(e){var t=e||{},n=(window.getSize().x-20).t oInt(),a=(window.getSize().y-137).toInt();(!t.width||t.width>n)&&(t.width=Math.m in(n,900)),(!t.height||t.height>a)&&(t.height=a),new SimpleModal({width:t.width, hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.set Style("overflow","hidden")},onHide:function(){document.body.setStyle("overflow", "auto")}}).show({title:t.title,contents:'<iframe src="'+t.url+'" width="100%" he ight="'+t.height+'" frameborder="0"></iframe>',model:"modal"})},openModalSelecto r:function(e){var d=e||{},t=(window.getSize().x-20).toInt(),n=(window.getSize(). y-192).toInt();d.id||(d.id="tl_select"),(!d.width||d.width>t)&&(d.width=Math.min (t,900)),(!d.height||d.height>n)&&(d.height=n);var a=new SimpleModal({width:d.wi dth,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("ove rflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}) ;a.addButton(Contao.lang.cancel,"btn",function(){this.buttons[0].hasClass("btn-d isabled")||this.hide()}),a.addButton(Contao.lang.apply,"btn primary",function(){ if(!this.buttons[1].hasClass("btn-disabled")){var e,t,n,a,o,i,l,s,r=window.frame s["simple-modal-iframe"],c=[];if(void 0!==r){for((l=(e=r.document.getElementById (d.id)).get("data-picker-value"))&&(c=JSON.parse(l)),t=e.getElementsByTagName("i nput"),i=0;i<t.length;i++)t[i].id.match(/^(check_all_|reset_)/)||(s=c.indexOf(t[ i].get("value")),t[i].checked?-1==s&&c.push(t[i].get("value")):-1!=s&&c.splice(s ,1));d.callback?d.callback(e.get("data-table"),c):d.tag&&(n=$(d.tag))?(window.co nsole&&console.warn("Using the modal selector without a callback function is dep recated. Please adjust your Contao DCA file."),n.value=c.join(","),(o=e.get("dat a-inserttag"))&&(n.value="{{"+o+"::"+n.value+"}}"),d.self.set("href",d.self.get( "href").replace(/&value=[^&]*/,"&value="+c.join(",")))):d.id&&(n=$("ctrl_"+d.id) )&&(a=e.get("data-callback"))&&(window.console&&console.warn("Using the modal se lector without a callback function is deprecated. Please adjust your Contao DCA file."),n.value=c.join("\t"),new Request.Contao({field:n,evalScripts:!1,onReques t:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(e,t){$("ct rl_"+d.id).getParent("div").set("html",t.content),t.javascript&&Browser.exec(t.j avascript),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action :a,name:d.id,value:n.value,REQUEST_TOKEN:Contao.request_token})),this.hide()}els e alert("Could not find the SimpleModal frame")}}),a.show({title:d.title,content s:'<iframe src="'+d.url+'" name="simple-modal-iframe" width="100%" height="'+d.h eight+'" frameborder="0"></iframe>',model:"modal"})},openModalBrowser:function(n ,e,t,a,o){Backend.openModalSelector({id:"tl_listing",title:a.document.getElement ("div.mce-title").get("text"),url:Contao.routes.backend_picker+"?context="+("fil e"==t?"link":"file")+"&amp;extras[fieldType]=radio&amp;extras[filesOnly]=true&am p;extras[source]="+o+"&amp;value="+e+"&amp;popup=1",callback:function(e,t){a.doc ument.getElementById(n).value=t.join(",")}})},getScrollOffset:function(){window. sessionStorage.setItem("contao_backend_offset",window.getScroll().y)},initScroll Offset:function(){Cookie.dispose("BE_PAGE_OFFSET"),$$('.tl_submit_container butt on[name][name!="save"]').each(function(e){e.addEvent("click",function(){window.s essionStorage.removeItem("contao_backend_offset")})});var e=window.sessionStorag e.getItem("contao_backend_offset");if(window.sessionStorage.removeItem("contao_b ackend_offset"),e){var t=window.document.getElementById("header"),i=0;t&&t.addCl ass("down"),$$("[data-add-to-scroll-offset]").each(function(e){var t=e.get("data -add-to-scroll-offset"),n=e.getScrollSize().y,a=!1,o=!1;t?("-"===t.charAt(0)&&(a =!0,t=t.substring(1)),"%"===t.charAt(t.length-1)&&(o=!0,t=t.substring(0,t.length -1)),t=parseInt(t,10),o&&(t=Math.round(n*t/100)),a&&(t*=-1),i+=t):i+=n}),this.vS crollTo(parseInt(e,10)+i)}},autoSubmit:function(e){Backend.getScrollOffset();var t=new Element("input",{type:"hidden",name:"SUBMIT_TYPE",value:"auto"}),n=$(e)|| e;t.inject(n,"bottom"),n.submit()},vScrollTo:function(e){window.addEvent("load", function(){window.scrollTo(null,parseInt(e))})},limitPreviewHeight:function(){va r l=0;$$("div.limit_height").each(function(e){var t,n,a,o,i=e.getParent(".tl_con tent");i&&(i.hasClass("wrapper_start")||i.hasClass("wrapper_stop"))||(0===l&&(l= e.className.replace(/[^0-9]*/,"").toInt()),l&&(t=new Element("div",{class:"limit _toggler"}),n=new Element("button",{type:"button",html:"<span>...</span>",class: "unselectable","data-state":0}).inject(t),a=e.getCoordinates(),e.setStyle("heigh t",l),a.height<=l||(n.addEvent("click",function(){o=t.getPrevious("div").getStyl e("height").toInt(),t.getPrevious("div").setStyle("height",l<o?l:""),n.set("data -state",n.get("data-state")?0:1)}),t.inject(e,"after"))))})},toggleCheckboxes:fu nction(e,t){for(var n=$$("input"),a=$(e).checked?"checked":"",o=0;o<n.length;o++ )"checkbox"==n[o].type.toLowerCase()&&(void 0!==t&&t!=n[o].id.substr(0,t.length) ||(n[o].checked=a))},toggleCheckboxGroup:function(e,t){var n=$(e).className,a=$( e).checked?"checked":"";"tl_checkbox"==n?($(t)?$$("#"+t+" .tl_checkbox"):$(e).ge tParent("fieldset").getElements(".tl_checkbox")).each(function(e){e.checked=a}): "tl_tree_checkbox"==n&&$$("#"+t+" .parent .tl_tree_checkbox").each(function(e){e .checked=a});Backend.getScrollOffset()},toggleCheckboxElements:function(e,t){var n=$(e).checked?"checked":"";$$("."+t).each(function(e){e.hasClass("tl_checkbox" )&&(e.checked=n)}),Backend.getScrollOffset()},toggleWrap:function(e){var t=$(e), n="off"==t.getProperty("wrap")?"soft":"off";t.setProperty("wrap",n)},toggleUncha nged:function(){$$("#result-list .tl_confirm").each(function(e){e.toggleClass("h idden")})},blink:function(){},addColorPicker:function(){return!0},collapsePalett es:function(){$$("fieldset.hide").each(function(e){e.addClass("collapsed")}),$$( "label.error, label.mandatory").each(function(e){var t=e.getParent("fieldset");t &&t.removeClass("collapsed")})},addInteractiveHelp:function(){new Tips.Contao("p .tl_tip",{offset:{x:9,y:23},text:function(e){return e.get("html")}}),new Tips.Co ntao($("home"),{offset:{x:15,y:42}}),new Tips.Contao($$("#tmenu a[title]").filte r(function(e){return""!=e.title}),{offset:{x:9,y:42}}),new Tips.Contao($$('a[tit le][class^="group-"]').filter(function(e){return""!=e.title}),{offset:{x:3,y:27} }),new Tips.Contao($$("a[title].navigation").filter(function(e){return""!=e.titl e}),{offset:{x:34,y:32}}),$$("img[title]").filter(function(e){return""!=e.title} ).each(function(e){new Tips.Contao(e,{offset:{x:0,y:"gimage"==e.get("class")?60: 30}})}),["a[title]","input[title]","button[title]","time[title]"].each(function( e){new Tips.Contao($$(e).filter(function(e){return""!=e.title}),{offset:{x:0,y:" time[title]"==e?26:30}})})},makeParentViewSortable:function(e){var t=new Scrolle r(document.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this .element.getScroll().x,t)}}),i=new Sortables(e,{constrain:!0,opacity:.6,onStart: function(){t.start()},onComplete:function(){t.stop()},onSort:function(e){var t,n ,a=e.getParent("ul"),o=0;if(a&&(t=a.getChildren("li > div:first-child")))for(n=0 ;n<t.length;n++)t[n].hasClass("wrapper_stop")&&0<o&&o--,t[n].className=t[n].clas sName.replace(/(^|\s)indent[^\s]*/g,""),0<o&&t[n].addClass("indent").addClass("i ndent_"+o),t[n].hasClass("wrapper_start")&&o++,t[n].removeClass("indent_first"), t[n].removeClass("indent_last"),t[n-1]&&t[n-1].hasClass("wrapper_start")&&t[n].a ddClass("indent_first"),t[n+1]&&t[n+1].hasClass("wrapper_stop")&&t[n].addClass(" indent_last")},handle:".drag-handle"});i.active=!1,i.addEvent("start",function() {i.active=!0}),i.addEvent("complete",function(e){var t,n,a,o;i.active&&(e.getPre vious("li")?(t=e.get("id").replace(/li_/,""),n=e.getPrevious("li").get("id").rep lace(/li_/,""),a=window.location.search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&m ode=1&pid="+n,o=window.location.href.replace(/\?.*$/,""),new Request.Contao({url :o+a,followRedirects:!1}).get()):e.getParent("ul")&&(t=e.get("id").replace(/li_/ ,""),n=e.getParent("ul").get("id").replace(/ul_/,""),a=window.location.search.re place(/id=[0-9]*/,"id="+t)+"&act=cut&mode=2&pid="+n,o=window.location.href.repla ce(/\?.*$/,""),new Request.Contao({url:o+a,followRedirects:!1}).get()))})},makeM ultiSrcSortable:function(a,o,i){var e=new Sortables($(a),{constrain:!0,opacity:. 6}).addEvent("complete",function(){var e,t=[],n=$(a).getChildren("li");for(e=0;e <n.length;e++)t.push(n[e].get("data-id"));$(o).value=t.join(",")});$(a).getEleme nts(".gimage").each(function(n){n.hasClass("removable")?new Element("button",{ty pe:"button",html:"&times;",class:"tl_red"}).addEvent("click",function(){var e=n. getParent("li"),t=e.get("data-id");$(i).value=$(i).value.split(",").filter(funct ion(e){return e!=t}).join(","),$(o).value=$(o).value.split(",").filter(function( e){return e!=t}).join(","),e.dispose()}).inject(n,"after"):new Element("button", {type:"button",html:"&times",disabled:!0}).inject(n,"after")}),e.fireEvent("comp lete")},enableFileTreeDragAndDrop:function(c,d){var u=new Scroller(document.getE lement("body"),{onChange:function(e,t){this.element.scrollTo(this.element.getScr oll().x,t)}});function g(e){return e&&e.hasClass("parent")&&e.getPrevious(".tl_f older")?e.getPrevious(".tl_folder"):e}c.addEvent("mousedown",function(e){var t=e .target.hasClass("drag-handle")?e.target:e.target.getParent(".drag-handle"),o=e. target.getParent(".tl_file,.tl_folder");if(t&&o&&!e.rightClick){u.start(),c.addC lass("tl_listing_dragging");var i,l,n=o.getElements(".tl_left")[0]||o,s=n.clone( !0).inject(c).addClass("tl_left_dragging");s.setPosition({x:e.page.x-n.getOffset Parent().getPosition().x-s.getSize().x,y:n.getPosition(n.getOffsetParent()).y}). setStyle("display","none");var a=new Drag.Move(s,{droppables:$$([c]).append(c.ge tElements(".tl_folder,li.parent,.tl_folder_top")),unDraggableTags:[],modifiers:{ x:"left",y:"top"},onStart:function(){s.setStyle("display","")},onEnter:function( e,t){if((t=g(t)).addClass("tl_folder_dropping"),t.hasClass("tl_folder")&&i!==t){ i=t,l=(new Date).getTime();var n=t.getElement('img[src$="/icons/folPlus.svg"]'); (n=n&&n.getParent("a"))&&setTimeout(function(){if(i===t&&l+900<(new Date).getTim e()){var e=document.createEvent("HTMLEvents");e.initEvent("click",!0,!0),n.dispa tchEvent(e),l=i=void 0,window.addEvent("ajax_change",function e(){a&&a.droppable s&&c&&c.getElements&&(a.droppables=$$([c]).append(c.getElements(".tl_folder,li.p arent"))),window.removeEvent("ajax_change",e)})}},1e3)}},onCancel:function(){l=i =void 0,u.stop(),s.destroy(),window.removeEvent("keyup",r),c.getElements(".tl_fo lder_dropping").removeClass("tl_folder_dropping"),c.removeClass("tl_listing_drag ging")},onDrop:function(e,t){if(l=i=void 0,u.stop(),s.destroy(),window.removeEve nt("keyup",r),c.getElements(".tl_folder_dropping").removeClass("tl_folder_droppi ng"),c.removeClass("tl_listing_dragging"),t=g(t)){var n=o.get("data-id"),a=t.get ("data-id")||decodeURIComponent(d.url.split(/[?&]pid=/)[1].split("&")[0]);n&&a&& (0===(a+"/").indexOf(n+"/")||a+"/"===n.replace(/[^/]+$/,""))||(Backend.getScroll Offset(),document.location.href=d.url+"&id="+encodeURIComponent(n)+"&pid="+encod eURIComponent(a))}},onLeave:function(e,t){(t=g(t)).removeClass("tl_folder_droppi ng"),l=i=void 0}});a.start(e),window.addEvent("keyup",r)}function r(e){"esc"===e .key&&a&&a.stop&&(a.droppables=$$([]),a.stop())}})},listWizard:function(e){var l =$(e),s=function(n){var e,a,o,i;n.getElements("button").each(function(t){if(!t.h asEvent("click"))switch(t.getProperty("data-command")){case"copy":t.addEvent("cl ick",function(){Backend.getScrollOffset(),e=n.clone(!0).inject(n,"before"),(a=n. getFirst("input"))&&(e.getFirst("input").value=a.value),s(e)});break;case"delete ":t.addEvent("click",function(){Backend.getScrollOffset(),1<l.getChildren().leng th&&n.destroy()});break;case null:t.addEvent("keydown",function(e){38==e.event.k eyCode?(e.preventDefault(),(o=n.getPrevious("li"))?n.inject(o,"before"):n.inject (l,"bottom"),t.focus()):40==e.event.keyCode&&(e.preventDefault(),(i=n.getNext("l i"))?n.inject(i,"after"):n.inject(l.getFirst("li"),"before"),t.focus())})}})};ne w Sortables(l,{constrain:!0,opacity:.6,handle:".drag-handle"}),l.getChildren().e ach(function(e){s(e)})},tableWizard:function(e){var t=$(e),d=t.getElement("thead "),u=t.getElement("tbody"),g=function(e){var t,n,a,o,i=e.getChildren();for(a=0;a <i.length;a++)for(n=i[a].getChildren(),o=0;o<n.length;o++)(t=n[o].getFirst("text area"))&&(t.name=t.name.replace(/\[[0-9]+][[0-9]+]/g,"["+a+"]["+o+"]"));new Sort ables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){g(e )}})},f=function(n){var e,a,o,i,l,s,r,c=d.getFirst("tr");n.getElements("button") .each(function(t){if(!t.hasEvent("click"))switch(t.getProperty("data-command")){ case"rcopy":t.addEvent("click",function(){for(Backend.getScrollOffset(),i=new El ement("tr"),l=n.getChildren(),r=0;r<l.length;r++)o=l[r].clone(!0).inject(i,"bott om"),(e=l[r].getFirst("textarea"))&&(o.getFirst("textarea").value=e.value);i.inj ect(n,"after"),f(i),g(u)});break;case"rdelete":t.addEvent("click",function(){Bac kend.getScrollOffset(),1<u.getChildren().length&&n.destroy(),g(u)});break;case"c copy":t.addEvent("click",function(){for(Backend.getScrollOffset(),s=h(t),l=u.get Children(),r=0;r<l.length;r++)a=l[r].getChildren()[s],o=a.clone(!0).inject(a,"af ter"),(e=a.getFirst("textarea"))&&(o.getFirst("textarea").value=e.value),f(o);o= c.getFirst("td").clone(!0).inject(c.getLast("td"),"before"),f(o),g(u)});break;ca se"cmovel":t.addEvent("click",function(){if(Backend.getScrollOffset(),s=h(t),l=u .getChildren(),0<s)for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).inject(a.get Previous(),"before");else for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).injec t(l[r].getLast(),"before");g(u)});break;case"cmover":t.addEvent("click",function (){if(Backend.getScrollOffset(),s=h(t),l=u.getChildren(),s<n.getChildren().lengt h-2)for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).inject(a.getNext(),"after") ;else for(r=0;r<l.length;r++)(a=l[r].getChildren()[s]).inject(l[r].getFirst(),"b efore");g(u)});break;case"cdelete":t.addEvent("click",function(){if(Backend.getS crollOffset(),s=h(t),l=u.getChildren(),2<n.getChildren().length){for(r=0;r<l.len gth;r++)l[r].getChildren()[s].destroy();c.getFirst("td").destroy()}g(u)});break; case null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefault (),(i=n.getPrevious("tr"))?n.inject(i,"before"):n.inject(u,"bottom"),t.focus(),g (u)):40==e.event.keyCode&&(e.preventDefault(),(i=n.getNext("tr"))?n.inject(i,"af ter"):n.inject(u,"top"),t.focus(),g(u))})}})},h=function(e){var t,n=$(e).getPare nt("td"),a=n.getParent("tr").getChildren(),o=0;for(t=0;t<a.length&&a[t]!=n;t++)o ++;return o};g(u),d.getChildren().each(function(e){f(e)}),u.getChildren().each(f unction(e){f(e)}),Backend.tableWizardResize()},tableWizardResize:function(t){var n=window.localStorage.getItem("contao_table_wizard_cell_size");if(void 0!==t)n= "",$$(".tl_tablewizard textarea").each(function(e){e.setStyle("width",(e.getStyl e("width").toInt()*t).round().limit(142,284)),e.setStyle("height",(e.getStyle("h eight").toInt()*t).round().limit(66,132)),""==n&&(n=e.getStyle("width")+"|"+e.ge tStyle("height"))}),window.localStorage.setItem("contao_table_wizard_cell_size", n);else if(null!==n){var a=n.split("|");$$(".tl_tablewizard textarea").each(func tion(e){e.setStyle("width",a[0]),e.setStyle("height",a[1])})}},tableWizardSetWid th:function(){var e=$("tl_tablewizard");e&&e.setStyle("width",Math.round(.96*e.g etParent(".tl_formbody_edit").getComputedSize().width))},moduleWizard:function(e ){var r=$(e).getElement("tbody"),c=function(e){var t,n,a,o,i,l=e.getChildren();f or(n=0;n<l.length;n++)for(t=l[n].getChildren(),a=0;a<t.length;a++)(o=t[a].getEle ment("select"))&&(o.name=o.name.replace(/\[[0-9]+]/g,"["+n+"]")),(i=t[a].getElem ent('input[type="checkbox"]'))&&(i.set("tabindex",-1),i.name=i.name.replace(/\[[ 0-9]+]/g,"["+n+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-hand le",onComplete:function(){c(e)}})},d=function(n){var e,a,o,i,l,s;n.getElements(" button").each(function(t){if(!t.hasEvent("click"))switch(t.getProperty("data-com mand")){case"copy":t.addEvent("click",function(){for(Backend.getScrollOffset(),o =new Element("tr"),i=n.getChildren(),s=0;s<i.length;s++)a=i[s].clone(!0).inject( o,"bottom"),(e=i[s].getElement("select"))&&(a.getElement("select").value=e.value );o.inject(n,"after"),o.getElement(".chzn-container").destroy(),new Chosen(o.get Element("select.tl_select")),d(o),c(r)});break;case"delete":t.addEvent("click",f unction(){Backend.getScrollOffset(),1<r.getChildren().length&&n.destroy(),c(r)}) ;break;case"enable":t.addEvent("click",function(){Backend.getScrollOffset(),(l=t .getNext('input[type="checkbox"]')).checked?(l.checked="",t.getElement("img").sr c=Backend.themePath+"icons/invisible.svg"):(l.checked="checked",t.getElement("im g").src=Backend.themePath+"icons/visible.svg"),c(r)});break;case null:t.addEvent ("keydown",function(e){38==e.event.keyCode?(e.preventDefault(),(o=n.getPrevious( "tr"))?n.inject(o,"before"):n.inject(r,"bottom"),t.focus(),c(r)):40==e.event.key Code&&(e.preventDefault(),(o=n.getNext("tr"))?n.inject(o,"after"):n.inject(r,"to p"),t.focus(),c(r))})}})};c(r),r.getChildren().each(function(e){d(e)})},optionsW izard:function(e){var s=$(e).getElement("tbody"),r=function(e){var t,n,a,o,i=e.g etChildren();for(n=0;n<i.length;n++)for(t=i[n].getChildren(),a=0;a<t.length;a++) (o=t[a].getFirst("input"))&&(o.name=o.name.replace(/\[[0-9]+]/g,"["+n+"]"),"chec kbox"==o.type&&(o.id=o.name.replace(/\[[0-9]+]/g,"").replace(/\[/g,"_").replace( /]/g,"")+"_"+n,o.getNext("label").set("for",o.id)));new Sortables(e,{constrain:! 0,opacity:.6,handle:".drag-handle",onComplete:function(){r(e)}})},c=function(n){ var e,a,o,i,l;n.getElements("button").each(function(t){if(!t.hasEvent("click"))s witch(t.getProperty("data-command")){case"copy":t.addEvent("click",function(){fo r(Backend.getScrollOffset(),o=new Element("tr"),i=n.getChildren(),l=0;l<i.length ;l++)a=i[l].clone(!0).inject(o,"bottom"),(e=i[l].getFirst("input"))&&(a.getFirst ("input").value=e.value,"checkbox"==e.type&&(a.getFirst("input").checked=e.check ed?"checked":""));o.inject(n,"after"),c(o),r(s)});break;case"delete":t.addEvent( "click",function(){Backend.getScrollOffset(),1<s.getChildren().length&&n.destroy (),r(s)});break;case null:t.addEvent("keydown",function(e){38==e.event.keyCode?( e.preventDefault(),(o=n.getPrevious("tr"))?n.inject(o,"before"):n.inject(s,"bott om"),t.focus(),r(s)):40==e.event.keyCode&&(e.preventDefault(),(o=n.getNext("tr") )?n.inject(o,"after"):n.inject(s,"top"),t.focus(),r(s))})}})};r(s),s.getChildren ().each(function(e){c(e)})},keyValueWizard:function(e){var s=$(e).getElement("tb ody"),r=function(e){var t,n,a,o,i=e.getChildren();for(n=0;n<i.length;n++)for(t=i [n].getChildren(),a=0;a<t.length;a++)(o=t[a].getFirst("input"))&&(o.name=o.name. replace(/\[[0-9]+]/g,"["+n+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle :".drag-handle",onComplete:function(){r(e)}})},c=function(n){var e,a,o,i,l;n.get Elements("button").each(function(t){if(!t.hasEvent("click"))switch(t.getProperty ("data-command")){case"copy":t.addEvent("click",function(){for(Backend.getScroll Offset(),o=new Element("tr"),i=n.getChildren(),l=0;l<i.length;l++)a=i[l].clone(! 0).inject(o,"bottom"),(e=i[l].getFirst("input"))&&(a.getFirst().value=e.value);o .inject(n,"after"),c(o),r(s)});break;case"delete":t.addEvent("click",function(){ Backend.getScrollOffset(),1<s.getChildren().length&&n.destroy(),r(s)});break;cas e null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefault(), (o=n.getPrevious("tr"))?n.inject(o,"before"):n.inject(s,"bottom"),t.focus(),r(s) ):40==e.event.keyCode&&(e.preventDefault(),(o=n.getNext("tr"))?n.inject(o,"after "):n.inject(s,"top"),t.focus(),r(s))})}})};r(s),s.getChildren().each(function(e) {c(e)})},checkboxWizard:function(e){var o=$(e).getElement(".sortable");new Sorta bles(o,{constrain:!0,opacity:.6,handle:".drag-handle"}),o.getChildren().each(fun ction(e){var n,a;(n=e).getElements("button").each(function(t){t.hasEvent("click" )||t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefault(),(a=n .getPrevious("span"))?n.inject(a,"before"):n.inject(o,"bottom"),t.focus()):40==e .event.keyCode&&(e.preventDefault(),(a=n.getNext("span"))?n.inject(a,"after"):n. inject(o,"top"),t.focus())})})})},metaDelete:function(e){var t=e.getParent("li") ;null===t.getPrevious()&&null===t.getNext()?t.getElements("input").each(function (e){e.value=""}):t.destroy()},toggleAddLanguageButton:function(e){var t=e.getPar ent("div").getElement('input[type="button"]');""!=e.value?t.removeProperty("disa bled"):t.setProperty("disabled",!0)},sectionWizard:function(e){var c=$(e).getEle ment("tbody"),d=function(e){var t,n,a,o=e.getChildren();for(n=0;n<o.length;n++)f or(t=o[n].getChildren(),a=0;a<t.length;a++)t[a].getElements("input").each(functi on(e){e.name=e.name.replace(/\[[0-9]+]/g,"["+n+"]")}),t[a].getElements("select") .each(function(e){e.name=e.name.replace(/\[[0-9]+]/g,"["+n+"]")});new Sortables( e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){d(e)}})}, u=function(n){var e,a,o,i,l,s,r;n.getElements("button").each(function(t){if(!t.h asEvent("click"))switch(t.getProperty("data-command")){case"copy":t.addEvent("cl ick",function(){for(Backend.getScrollOffset(),a=new Element("tr"),o=n.getChildre n(),s=0;s<o.length;s++)for(e=o[s].clone(!0).inject(a,"bottom"),i=o[s].getElement s("select"),l=e.getElements("select"),r=0;r<i.length;r++)l[r].value=i[r].value;a .inject(n,"after"),u(a),d(c)});break;case"delete":t.addEvent("click",function(){ Backend.getScrollOffset(),1<c.getChildren().length&&n.destroy(),d(c)});break;cas e null:t.addEvent("keydown",function(e){38==e.event.keyCode?(e.preventDefault(), (a=n.getPrevious("tr"))?n.inject(a,"before"):n.inject(c,"bottom"),t.focus(),d(c) ):40==e.event.keyCode&&(e.preventDefault(),(a=n.getNext("tr"))?n.inject(a,"after "):n.inject(c,"top"),t.focus(),d(c))})}})};d(c),c.getChildren().each(function(e) {u(e)})},updateModuleLink:function(e){var t=e.getParent("tr").getLast("td"),n=t. getElement("a.module_link");n.href=n.href.replace(/id=[0-9]+/,"id="+e.value),0<e .value?(t.getElement("a.module_link").setStyle("display",null),t.getElement("img .module_image").setStyle("display","none")):(t.getElement("a.module_link").setSt yle("display","none"),t.getElement("img.module_image").setStyle("display",null)) },enableImageSizeWidgets:function(){$$(".tl_image_size").each(function(e){functi on t(){if(""===n.get("value")||0===n.get("value").indexOf("_")||n.get("value").t oInt().toString()===n.get("value")){a.readOnly=!0,o.readOnly=!0;var e=$(n.getSel ected()[0]).get("text");e=1<e.split("(").length?e.split("(").getLast().split(")" )[0].split("x"):["",""],a.set("value","").set("placeholder",+e[0]||""),o.set("va lue","").set("placeholder",+e[1]||"")}else a.set("placeholder",""),o.set("placeh older",""),a.readOnly=!1,o.readOnly=!1}var n=e.getElement("select"),a=e.getChild ren("input")[0],o=e.getChildren("input")[1];t(),n.addEvent("change",t),n.addEven t("keyup",t)})},enableToggleSelect:function(){function a(e){for(t=r.indexOf(e),n =r.indexOf(o),l=Math.min(t,n),s=Math.max(t,n),i=!!r[n].checked;l<=s;l++)r[l].che cked=i}var o,t,n,i,l,s,e=$("tl_listing"),r=[];e&&(r=e.getElements('input[type="c heckbox"]')),$$(".toggle_select").each(function(e){var t=e.retrieve("boundEvent" );t&&e.removeEvent("click",t),e.getElements('label,input[type="checkbox"],input[ type="radio"]').each(function(e){e.addEvent("click",function(e){e.stopPropagatio n()})}),t=function(e){var t=this.getElement('input[type="checkbox"],input[type=" radio"]'),n=$(e.target).getParent(".limit_toggler");t&&!t.get("disabled")&&null= ==n&&("radio"!=t.type?(e.shift&&o?a(t):(t.checked=t.checked?"":"checked","Backen d.toggleCheckboxes(this)"==t.get("onclick")&&Backend.toggleCheckboxes(t)),o=t):t .checked||(t.checked="checked"))}.bind(e),e.addEvent("click",t),e.store("boundEv ent",t)}),r.each(function(e){e.addEvent("click",function(e){e.shift&&o&&a(this), o=this})})},autoFocusFirstInputField:function(){var e=document.id("main").getEle ment(".tl_formbody_edit");if(e){var t=e.getElements("input, textarea").filter(fu nction(e){return!e.get("disabled")&&e.isVisible()&&"checkbox"!==e.get("type")&&" radio"!==e.get("type")&&"submit"!==e.get("type")&&"image"!==e.get("type")});t[0] &&t[0].focus()}},editPreviewWizard:function(s){function r(){return{x:u.getComput edSize().width,y:u.getComputedSize().height}}function e(){var e=r(),t=u.getCompu tedSize();c.setStyles({top:t.computedTop+(g.y.get("value")*e.y).round()+"px",lef t:t.computedLeft+(g.x.get("value")*e.x).round()+"px",width:(g.width.get("value") *e.x).round()+"px",height:(g.height.get("value")*e.y).round()+"px"}),g.width.get ("value").toFloat()&&g.height.get("value").toFloat()?c.setStyle("display",null): c.setStyle("display","none")}function t(e){e.preventDefault(),f||(f=!0,d={x:e.pa ge.x-s.getPosition().x-u.getComputedSize().computedLeft,y:e.page.y-s.getPosition ().y-u.getComputedSize().computedTop},a(e))}function n(e){a(e),f=!1}var c,d,u=(s =$(s)).getElement("img"),g={},f=!1,a=function(e){if(f){e.preventDefault();var t, n,a,o,i=u.getComputedSize(),l={x:[Math.max(0,Math.min(i.width,d.x)),Math.max(0,M ath.min(i.width,e.page.x-s.getPosition().x-i.computedLeft))],y:[Math.max(0,Math. min(i.height,d.y)),Math.max(0,Math.min(i.height,e.page.y-s.getPosition().y-i.com putedTop))]};c.setStyles({top:Math.min(l.y[0],l.y[1])+i.computedTop+"px",left:Ma th.min(l.x[0],l.x[1])+i.computedLeft+"px",width:Math.abs(l.x[0]-l.x[1])+"px",hei ght:Math.abs(l.y[0]-l.y[1])+"px"}),t=r(),n=c.getStyles("top","left","width","hei ght"),a=u.getComputedSize(),(o={x:Math.max(0,Math.min(1,(n.left.toFloat()-a.comp utedLeft)/t.x)),y:Math.max(0,Math.min(1,(n.top.toFloat()-a.computedTop)/t.y))}). width=Math.min(1-o.x,n.width.toFloat()/t.x),o.height=Math.min(1-o.y,n.height.toF loat()/t.y),o.width&&o.height?c.setStyle("display",null):(o.x=o.y=o.width=o.heig ht="",c.setStyle("display","none")),Object.each(o,function(e,t){g[t].set("value" ,e)})}};window.addEvent("domready",function(){s.getParent(".tl_tbox,.tl_box").ge tElements('input[name^="importantPart"]').each(function(t){["x","y","width","hei ght"].each(function(e){t.get("name").substr(13,e.length)===e.capitalize()&&(g[e] =t=$(t))})}),4===Object.getLength(g)&&(Object.each(g,function(e){e.getParent().s etStyle("display","none")}),s.addClass("tl_edit_preview_enabled"),c=new Element( "div",{class:"tl_edit_preview_important_part"}).inject(s),e(),u.addEvent("load", e),s.addEvents({mousedown:t,touchstart:t}),$(document.documentElement).addEvents ({mousemove:a,touchmove:a,mouseup:n,touchend:n,touchcancel:n,resize:e}))})},enab leFileTreeUpload:function(i,e){i=$(i);var l,s,r=e.url,t=new Element("div",{class :"dropzone dropzone-filetree",html:'<span class="dropzone-previews"></span>'}).i nject(i,"top");e.previewsContainer=t.getElement(".dropzone-previews"),e.clickabl e=!1;var c=new Dropzone(i,e);c.on("queuecomplete",function(){window.location.rel oad()}),c.on("dragover",function(e){if(e.dataTransfer&&e.dataTransfer.types&&-1! ==e.dataTransfer.types.indexOf("Files")){i.getElements(".tl_folder_dropping").re moveClass("tl_folder_dropping");var t=e.target&&$(e.target);if(t){var n=t.match( ".tl_folder")?t:t.getParent(".tl_folder");if(n=n||(n=t.getParent(".parent"))&&n. getPrevious(".tl_folder")){var a=n.getElement('img[src$="/icons/new.svg"]');a=a& &a.getParent("a")}}if(a&&a.href){if(c.options.url=""+a.href,n.addClass("tl_folde r_dropping"),l!==n){l=n,s=(new Date).getTime();var o=n.getElement('img[src$="/ic ons/folPlus.svg"]');(o=o&&o.getParent("a"))&&setTimeout(function(){if(l===n&&s+9 00<(new Date).getTime()){var e=document.createEvent("HTMLEvents");e.initEvent("c lick",!0,!0),o.dispatchEvent(e),s=l=void 0}},1e3)}}else c.options.url=r,s=l=void 0}}),c.on("drop",function(e){e.dataTransfer&&e.dataTransfer.types&&-1!==e.dataT ransfer.types.indexOf("Files")&&(t.addClass("dropzone-filetree-enabled"),Backend .getScrollOffset())}),c.on("dragleave",function(){i.getElements(".tl_folder_drop ping").removeClass("tl_folder_dropping"),s=l=void 0})},crawl:function(){var a=2e 3,e=$("tl_crawl"),c=e.getElement("div.progress-bar"),d=e.getElement("p.progress- count"),u=e.getElement("div.results");!function n(){new Request({url:window.loca tion.href,onSuccess:function(e){var t=JSON.decode(e);!function(e){var t,n=e.tota l-e.pending,a=0<e.total?parseInt(n/e.total*100,10):100;if(c.setStyle("width",a+" %"),c.set("html",a+"%"),c.setAttribute("aria-valuenow",a),d.set("html",n+" / "+e .total),e.finished)for(t in c.removeClass("running").addClass("finished"),u.remo veClass("running").addClass("finished"),e.results)if(e.results.hasOwnProperty(t) ){var o=u.getElement('.result[data-subscriber="'+t+'"] p.summary'),i=u.getElemen t('.result[data-subscriber="'+t+'"] p.warning'),l=u.getElement('.result[data-sub scriber="'+t+'"] p.subscriber-log'),s=e.results[t],r=s.summary;s.warning&&i.set( "html",s.warning),s.hasLog&&l.setStyle("display","block"),o.addClass(s.wasSucces sful?"success":"failure"),o.set("html",r)}}(t),t.finished||setTimeout(n,a)}}).se nd()}()}};document.addEvent("mousedown",function(e){Backend.getMousePosition(e)} ),window.addEvent("domready",function(){$(document.body).addClass("js"),Browser. Features.Touch&&$(document.body).addClass("touch"),Backend.collapsePalettes(),Ba ckend.addInteractiveHelp(),Backend.tableWizardSetWidth(),Backend.enableImageSize Widgets(),Backend.enableToggleSelect(),Backend.autoFocusFirstInputField(),null!= Elements.chosen&&$$("select.tl_chosen").chosen(),$$("textarea.monospace").each(f unction(e){Backend.toggleWrap(e)})}),window.addEvent("resize",function(){Backend .tableWizardSetWidth()}),window.addEvent("load",function(){Backend.limitPreviewH eight()}),window.addEvent("ajax_change",function(){Backend.addInteractiveHelp(), Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=Elements.cho sen&&$$("select.tl_chosen").filter(function(e){return"none"!=e.getStyle("display ")}).chosen()});
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)