From 7ec91ee75227f5c8801f49354714ae6b47690248 Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Mon, 17 Nov 2014 14:23:48 +0100 Subject: [PATCH] Add an empty option to the image size select menu (see #7436) --- assets/contao/js/core-uncompressed.js | 6 +++++- assets/contao/js/core.js | 2 +- system/docs/CHANGELOG.md | 6 ++++++ system/modules/calendar/dca/tl_calendar_events.php | 2 +- system/modules/core/dca/tl_content.php | 2 +- system/modules/core/dca/tl_module.php | 2 +- system/modules/faq/dca/tl_faq.php | 2 +- system/modules/news/dca/tl_news.php | 2 +- 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/assets/contao/js/core-uncompressed.js b/assets/contao/js/core-uncompressed.js index d007b13845..abe46e2209 100644 --- a/assets/contao/js/core-uncompressed.js +++ b/assets/contao/js/core-uncompressed.js @@ -1242,6 +1242,7 @@ var Backend = * @param {object} ul The DOM element * * @author Joe Ray Gregory + * @author Martin Auswöger */ makeParentViewSortable: function(ul) { var ds = new Scroller(document.getElement('body'), { @@ -1273,10 +1274,13 @@ var Backend = if (div.hasClass('wrapper_stop') && wrapLevel > 0) { wrapLevel--; } + div.className = div.className.replace(/(^|\s)indent[^\s]*/g, ''); + if (wrapLevel > 0) { div.addClass('indent').addClass('indent_' + wrapLevel); } + if (div.hasClass('wrapper_start')) { wrapLevel++; } @@ -2009,7 +2013,7 @@ var Backend = widthInput = el.getChildren('input')[0], heightInput = el.getChildren('input')[1], update = function() { - if (select.get('value').toInt().toString() === select.get('value')) { + if (select.get('value') === '' || select.get('value').toInt().toString() === select.get('value')) { widthInput.readOnly = true; heightInput.readOnly = true; var dimensions = $(select.getSelected()[0]).get('text'); diff --git a/assets/contao/js/core.js b/assets/contao/js/core.js index f74b7865d0..60fb19fdfa 100644 --- a/assets/contao/js/core.js +++ b/assets/contao/js/core.js @@ -1,3 +1,3 @@ /* Contao Open Source CMS, (c) 2005-2014 Leo Feyer, LGPL license */ -var AjaxRequest={toggleNavigation:function(e,t){e.blur();var n=$(t),a=$(e).getFirst("img");return n?("none"==n.getStyle("display")?(n.setStyle("display","inline"),a.src=a.src.replace("modPlus.gif","modMinus.gif"),$(e).store("tip:title",Contao.lang.collapse),(new Request.Contao).post({action:"toggleNavigation",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(n.setStyle("display","none"),a.src=a.src.replace("modMinus.gif","modPlus.gif"),$(e).store("tip:title",Contao.lang.expand),(new Request.Contao).post({action:"toggleNavigation",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(n){var o=new Element("li",{id:t,"class":"tl_parent",html:n,styles:{display:"inline"}}).inject($(e).getParent("li"),"after");o.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(e).store("tip:title",Contao.lang.collapse),a.src=a.src.replace("modPlus.gif","modMinus.gif"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadNavigation",id:t,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleStructure:function(e,t,n,a){e.blur();var o=$(t),i=$(e).getFirst("img");return o?("none"==o.getStyle("display")?(o.setStyle("display","inline"),i.src=i.src.replace("folPlus.gif","folMinus.gif"),$(e).store("tip:title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(o.setStyle("display","none"),i.src=i.src.replace("folMinus.gif","folPlus.gif"),$(e).store("tip:title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(o){{var l=new Element("li",{id:t,"class":"parent",styles:{display:"inline"}});new Element("ul",{"class":"level_"+n,html:o}).inject(l,"bottom")}if(5==a)l.inject($(e).getParent("li"),"after");else{for(var r,s=!1,c=$(e).getParent("li");"element"==typeOf(c)&&(r=c.getNext("li"));)if(c=r,c.hasClass("tl_folder")){s=!0;break}s?l.inject(c,"before"):l.inject(c,"after")}l.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(e).store("tip:title",Contao.lang.collapse),i.src=i.src.replace("folPlus.gif","folMinus.gif"),window.fireEvent("structure"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadStructure",id:t,level:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleFileManager:function(e,t,n,a){e.blur();var o=$(t),i=$(e).getFirst("img"),l=$(e).getNext("img");return o?("none"==o.getStyle("display")?(o.setStyle("display","inline"),i.src=i.src.replace("folPlus.gif","folMinus.gif"),l.src=l.src.replace("folderC","folderO"),$(e).store("tip:title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(o.setStyle("display","none"),i.src=i.src.replace("folMinus.gif","folPlus.gif"),l.src=l.src.replace("folderO","folderC"),$(e).store("tip:title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(n){{var o=new Element("li",{id:t,"class":"parent",styles:{display:"inline"}});new Element("ul",{"class":"level_"+a,html:n}).inject(o,"bottom")}o.inject($(e).getParent("li"),"after"),o.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(e).store("tip:title",Contao.lang.collapse),i.src=i.src.replace("folPlus.gif","folMinus.gif"),l.src=l.src.replace("folderC.gif","folderO.gif"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadFileManager",id:t,level:a,folder:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},togglePagetree:function(e,t,n,a,o){e.blur(),Backend.getScrollOffset();var i=$(t),l=$(e).getFirst("img");return i?("none"==i.getStyle("display")?(i.setStyle("display","inline"),l.src=l.src.replace("folPlus.gif","folMinus.gif"),$(e).store("tip:title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"togglePagetree",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(i.setStyle("display","none"),l.src=l.src.replace("folMinus.gif","folPlus.gif"),$(e).store("tip:title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"togglePagetree",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(n){{var a=new Element("li",{id:t,"class":"parent",styles:{display:"inline"}});new Element("ul",{"class":"level_"+o,html:n}).inject(a,"bottom")}a.inject($(e).getParent("li"),"after"),a.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(e).store("tip:title",Contao.lang.collapse),l.src=l.src.replace("folPlus.gif","folMinus.gif"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadPagetree",id:t,level:o,field:n,name:a,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleFiletree:function(e,t,n,a,o,i){e.blur(),Backend.getScrollOffset();var l=$(t),r=$(e).getFirst("img");return l?("none"==l.getStyle("display")?(l.setStyle("display","inline"),r.src=r.src.replace("folPlus.gif","folMinus.gif"),$(e).store("tip:title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleFiletree",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(l.setStyle("display","none"),r.src=r.src.replace("folMinus.gif","folPlus.gif"),$(e).store("tip:title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleFiletree",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(n){{var a=new Element("li",{id:t,"class":"parent",styles:{display:"inline"}});new Element("ul",{"class":"level_"+i,html:n}).inject(a,"bottom")}a.inject($(e).getParent("li"),"after"),a.getElements("a").each(function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)}),$(e).store("tip:title",Contao.lang.collapse),r.src=r.src.replace("folPlus.gif","folMinus.gif"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadFiletree",id:t,folder:n,level:i,field:a,name:o,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleSubpalette:function(e,t,n){e.blur();var a=$(t);return a?void(e.value?(e.value="",e.checked="",a.setStyle("display","none"),new Request.Contao({field:e}).post({action:"toggleSubpalette",id:t,field:n,state:0,REQUEST_TOKEN:Contao.request_token})):(e.value=1,e.checked="checked",a.setStyle("display","block"),new Request.Contao({field:e}).post({action:"toggleSubpalette",id:t,field:n,state:1,REQUEST_TOKEN:Contao.request_token}))):void new Request.Contao({field:e,evalScripts:!1,onRequest:AjaxRequest.displayBox(Contao.lang.loading+" …"),onSuccess:function(n,a){var o=new Element("div",{id:t,html:n,styles:{display:"block"}}).inject($(e).getParent("div").getParent("div"),"after");a.javascript&&(document.write=function(e){var t="";e.replace(/