diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 1ce038a081ecf..55b90d270b044 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -322,8 +322,9 @@ Joomla.editors.instances = Joomla.editors.instances || { messagesBox = document.createElement( 'div' ); // Message class - alertClass = (type == 'notice') ? 'alert-info' : 'alert-' + type; - alertClass = (type == 'message') ? 'alert-success' : alertClass; + alertClass = (type === 'notice') ? 'alert-info' : 'alert-' + type; + alertClass = (type === 'message') ? 'alert-success' : alertClass; + alertClass = (type === 'error') ? 'alert-error alert-danger' : alertClass; messagesBox.className = 'alert ' + alertClass; diff --git a/media/system/js/core.js b/media/system/js/core.js index 7bbab0352719a..ba21634af2194 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1,16 +1 @@ -Joomla=window.Joomla||{};Joomla.editors=Joomla.editors||{};Joomla.editors.instances=Joomla.editors.instances||{}; -(function(c,g){c.submitform=function(a,b,e){b||(b=g.getElementById("adminForm"));a&&(b.task.value=a);b.noValidate=!e;e?b.hasAttribute("novalidate")&&b.removeAttribute("novalidate"):b.setAttribute("novalidate","");a=g.createElement("input");a.style.display="none";a.type="submit";b.appendChild(a).click();b.removeChild(a)};c.submitbutton=function(a){c.submitform(a)};c.JText={strings:{},_:function(a,b){var e=c.getOptions("joomla.jtext");e&&(this.load(e),c.loadOptions({"joomla.jtext":null}));b=void 0=== -b?"":b;a=a.toUpperCase();return void 0!==this.strings[a]?this.strings[a]:b},load:function(a){for(var b in a)a.hasOwnProperty(b)&&(this.strings[b.toUpperCase()]=a[b]);return this}};c.optionsStorage=c.optionsStorage||null;c.getOptions=function(a,b){c.optionsStorage||c.loadOptions();return void 0!==c.optionsStorage[a]?c.optionsStorage[a]:b};c.loadOptions=function(a){if(!a){for(var b=g.querySelectorAll(".joomla-script-options.new"),e,d,h=0,f=0,m=b.length;f"+a.responseJSON.message+""]:a.statusText?[c.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",a.status)+" "+a.statusText+""]:[c.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",a.status)];return e};c.isChecked=function(a,b){"undefined"===typeof b&&(b=g.getElementById("adminForm"));b.boxchecked.value=a?parseInt(b.boxchecked.value)+1:parseInt(b.boxchecked.value)-1;if(b.elements["checkall-toggle"]){var e= -!0,d;var c=0;for(d=b.elements.length;c";d=e==d;var h;for(h=0;h"+k[2]+""}}a+="";f?f.innerHTML=a:g.writeln(a)};window.changeDynaList=function(a,b,e,d,c){a=g.adminForm[a];d=e==d;for(var f,h,k,l;a.firstChild;)a.removeChild(a.firstChild);f=0;for(h in b)if(b.hasOwnProperty(h)&&(k=b[h],k[0]==e)){l=new Option;l.value=k[1];l.text= -k[2];if(d&&c==l.value||!d&&0===f)l.selected=!0;a.options[f++]=l}a.length=f};window.radioGetCheckedValue=function(a){if(!a)return"";var b=a.length,e;if(void 0===b)return a.checked?a.value:"";for(e=0;e=0;s--)(l=t.createElement("div")).innerHTML=r[s],i.appendChild(l);c.appendChild(i)}},e.removeMessages=function(){for(var e=t.getElementById("system-message-container");e.firstChild;)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},e.ajaxErrorsMessages=function(t,o,n){var r={};if("parsererror"===o){for(var i=t.responseText.trim(),a=[],s=i.length-1;s>=0;s--)a.unshift(["&#",i[s].charCodeAt(),";"].join(""));i=a.join(""),r.error=[e.JText._("JLIB_JS_AJAX_ERROR_PARSE").replace("%s",i)]}else"nocontent"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_NO_CONTENT")]:"timeout"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_TIMEOUT")]:"abort"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_CONNECTION_ABORT")]:t.responseJSON&&t.responseJSON.message?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.responseJSON.message+""]:t.statusText?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.statusText+""]:r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)];return r},e.isChecked=function(e,o){if(void 0===o&&(o=t.getElementById("adminForm")),o.boxchecked.value=e?parseInt(o.boxchecked.value)+1:parseInt(o.boxchecked.value)-1,o.elements["checkall-toggle"]){var n,r,i,a=!0;for(n=0,i=o.elements.length;n",u=n==r,m=0;for(l in o)o.hasOwnProperty(l)&&(d=o[l])[0]==n&&(s="",(u&&i==d[1]||!u&&0===m)&&(s='selected="selected"'),c+='",m++);c+="",a?a.innerHTML=c:t.writeln(c)},window.changeDynaList=function(e,o,n,r,i){for(var a,s,l,d,c=t.adminForm[e],u=n==r;c.firstChild;)c.removeChild(c.firstChild);for(s in a=0,o)o.hasOwnProperty(s)&&(l=o[s])[0]==n&&((d=new Option).value=l[1],d.text=l[2],(u&&i==d.value||!u&&0===a)&&(d.selected=!0),c.options[a++]=d);c.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t,o=e.length;if(void 0===o)return e.checked?e.value:"";for(t=0;t-1?n.options[r].value:null},window.listItemTask=function(t,o){return e.listItemTask(t,o)},e.listItemTask=function(e,o){var n,r=t.adminForm,i=0,a=r[e];if(!a)return!1;for(;n=r["cb"+i];)n.checked=!1,i++;return a.checked=!0,r.boxchecked.value=1,window.submitform(o),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){window.checkAll_button(e,t)},window.checkAll_button=function(o,n){var r,i;for(n=n||"saveorder",r=0;r<=o;r++){if(!(i=t.adminForm["cb"+r]))return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");i.checked=!0}e.submitform(n)},e.loadingLayer=function(o,n){if(o=o||"show",n=n||t.body,"load"===o){var r=(e.getOptions("system.paths")||{}).root||"",i=t.createElement("div");i.id="loading-logo",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.opacity="0.8",i.style.filter="alpha(opacity=80)",i.style.overflow="hidden",i.style["z-index"]="10000",i.style.display="none",i.style["background-color"]="#fff",i.style["background-image"]='url("'+r+'/media/jui/images/ajax-loader.gif")',i.style["background-position"]="center",i.style["background-repeat"]="no-repeat",i.style["background-attachment"]="fixed",n.appendChild(i)}else t.getElementById("loading-logo")||e.loadingLayer("load",n),t.getElementById("loading-logo").style.display="show"==o?"block":"none";return t.getElementById("loading-logo")},e.extend=function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},e.request=function(t){(t=e.extend({url:"",method:"GET",data:null,perform:!0},t)).method=t.data?"POST":t.method.toUpperCase();try{var o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");if(o.open(t.method,t.url,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("X-Ajax-Engine","Joomla!"),"POST"===t.method){var n=e.getOptions("csrf.token","");n&&o.setRequestHeader("X-CSRF-Token",n),t.headers&&t.headers["Content-Type"]||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(t.headers)for(var r in t.headers)t.headers.hasOwnProperty(r)&&o.setRequestHeader(r,t.headers[r]);if(o.onreadystatechange=function(){4===o.readyState&&(200===o.status?t.onSuccess&&t.onSuccess.call(window,o.responseText,o):t.onError&&t.onError.call(window,o))},t.perform){if(t.onBefore&&!1===t.onBefore.call(window,o))return o;o.send(t.data)}}catch(e){return window.console&&console.log(e),!1}return o}}(Joomla,document); \ No newline at end of file