primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,161 @@
/**
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* ajaxChosen javascript behavior
*
* Used for displaying tags
*
* @package Joomla.JavaScript
* @since 1.5
* @version 1.0
*/
(function($) {
return $.fn.ajaxChosen = function(settings, callback, chosenOptions) {
var chosenXhr, defaultOptions, options, select;
if (settings == null) {
settings = {};
}
if (callback == null) {
callback = {};
}
if (chosenOptions == null) {
chosenOptions = function() {};
}
defaultOptions = {
minTermLength: 3,
afterTypeDelay: 500,
jsonTermKey: "term",
keepTypingMsg: Joomla.Text._('JGLOBAL_KEEP_TYPING'),
lookingForMsg: Joomla.Text._('JGLOBAL_LOOKING_FOR')
};
select = this;
chosenXhr = null;
options = $.extend({}, defaultOptions, $(select).data(), settings);
this.jchosen(chosenOptions ? chosenOptions : {});
return this.each(function() {
return $(this).next('.chosen-container').find(".search-field > input, .chosen-search > input").bind('keyup', function() {
var field, msg, success, untrimmed_val, val;
untrimmed_val = $(this).val();
val = $.trim($(this).val());
msg = val.length < options.minTermLength ? options.keepTypingMsg : options.lookingForMsg + (" '" + val + "'");
select.next('.chosen-container').find('.no-results').text(msg);
if (val === $(this).data('prevVal')) {
return false;
}
$(this).data('prevVal', val);
if (this.timer) {
clearTimeout(this.timer);
}
if (val.length < options.minTermLength) {
return false;
}
field = $(this);
if (!(options.data != null)) {
options.data = {};
}
options.data[options.jsonTermKey] = val;
if (options.dataCallback != null) {
options.data = options.dataCallback(options.data);
}
success = options.success;
options.success = function(data) {
var items, nbItems, selected_values;
if (!(data != null)) {
return;
}
selected_values = [];
select.find('option').each(function() {
if (!$(this).is(":selected")) {
return $(this).remove();
} else {
return selected_values.push($(this).val() + "-" + $(this).text());
}
});
select.find('optgroup:empty').each(function() {
return $(this).remove();
});
items = callback.apply(null, data);
nbItems = 0;
$.each(items, function(i, element) {
var group, text, value;
nbItems++;
if (element.group) {
group = select.find("optgroup[label='" + element.text + "']");
if (!group.size()) {
group = $("<optgroup />");
}
group.attr('label', element.text).appendTo(select);
return $.each(element.items, function(i, element) {
var text, value;
if (typeof element === "string") {
value = i;
text = element;
} else {
value = element.value;
text = element.text;
}
if ($.inArray(value + "-" + text, selected_values) === -1) {
return $("<option />").attr('value', value).html(text).appendTo(group);
}
});
} else {
if (typeof element === "string") {
value = i;
text = element;
} else {
value = element.value;
text = element.text;
}
if ($.inArray(value + "-" + text, selected_values) === -1) {
return $("<option />").attr('value', value).html(text).appendTo(select);
}
}
});
if (nbItems) {
select.trigger("chosen:updated");
} else {
select.data().jchosen.no_results_clear();
select.data().jchosen.no_results(field.val());
}
if (success != null) {
success(data);
}
return field.val(untrimmed_val);
};
return this.timer = setTimeout(function() {
if (chosenXhr) {
chosenXhr.abort();
}
return chosenXhr = $.ajax(options);
}, options.afterTypeDelay);
});
});
};
})(jQuery);
jQuery(document).ready(function ($) {
if (Joomla.getOptions('ajax-chosen')) {
var options = Joomla.getOptions('ajax-chosen');
$(options.selector).ajaxChosen({
type: options.type,
url: options.url,
dataType: options.dataType,
jsonTermKey: options.jsonTermKey,
afterTypeDelay: options.afterTypeDelay,
minTermLength: options.minTermLength
}, function (data) {
var results = [];
$.each(data, function (i, val) {
results.push({ value: val.value, text: val.text });
});
return results;
});
}
});

4
media/legacy/js/ajax-chosen.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/**
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(function(e){return e.fn.ajaxChosen=function(a,s,i){var l,o,t,r;return a==null&&(a={}),s==null&&(s={}),i==null&&(i=function(){}),o={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term",keepTypingMsg:Joomla.Text._("JGLOBAL_KEEP_TYPING"),lookingForMsg:Joomla.Text._("JGLOBAL_LOOKING_FOR")},r=this,l=null,t=e.extend({},o,e(r).data(),a),this.jchosen(i||{}),this.each(function(){return e(this).next(".chosen-container").find(".search-field > input, .chosen-search > input").bind("keyup",function(){var v,j,g,_,u;return _=e(this).val(),u=e.trim(e(this).val()),j=u.length<t.minTermLength?t.keepTypingMsg:t.lookingForMsg+(" '"+u+"'"),r.next(".chosen-container").find(".no-results").text(j),u===e(this).data("prevVal")||(e(this).data("prevVal",u),this.timer&&clearTimeout(this.timer),u.length<t.minTermLength)?!1:(v=e(this),t.data==null&&(t.data={}),t.data[t.jsonTermKey]=u,t.dataCallback!=null&&(t.data=t.dataCallback(t.data)),g=t.success,t.success=function(T){var L,x,h;if(T!=null)return h=[],r.find("option").each(function(){return e(this).is(":selected")?h.push(e(this).val()+"-"+e(this).text()):e(this).remove()}),r.find("optgroup:empty").each(function(){return e(this).remove()}),L=s.apply(null,T),x=0,e.each(L,function(J,n){var f,c,p;if(x++,n.group)return f=r.find("optgroup[label='"+n.text+"']"),f.size()||(f=e("<optgroup />")),f.attr("label",n.text).appendTo(r),e.each(n.items,function(K,d){var y,m;if(typeof d=="string"?(m=K,y=d):(m=d.value,y=d.text),e.inArray(m+"-"+y,h)===-1)return e("<option />").attr("value",m).html(y).appendTo(f)});if(typeof n=="string"?(p=J,c=n):(p=n.value,c=n.text),e.inArray(p+"-"+c,h)===-1)return e("<option />").attr("value",p).html(c).appendTo(r)}),x?r.trigger("chosen:updated"):(r.data().jchosen.no_results_clear(),r.data().jchosen.no_results(v.val())),g?.(T),v.val(_)},this.timer=setTimeout(function(){return l&&l.abort(),l=e.ajax(t)},t.afterTypeDelay))})})}})(jQuery),jQuery(document).ready(function(e){if(Joomla.getOptions("ajax-chosen")){var a=Joomla.getOptions("ajax-chosen");e(a.selector).ajaxChosen({type:a.type,url:a.url,dataType:a.dataType,jsonTermKey:a.jsonTermKey,afterTypeDelay:a.afterTypeDelay,minTermLength:a.minTermLength},function(s){var i=[];return e.each(s,function(l,o){i.push({value:o.value,text:o.text})}),i})}});

Binary file not shown.

View File

@ -0,0 +1,102 @@
(function($, Chosen, AbstractChosen) {
$.fn.jchosen = function (options) {
if (!AbstractChosen.browser_is_supported()) {
return this;
}
return this.each(function (input_field) {
var $this, chosen;
$this = $(this);
chosen = $this.data('chosen');
if (options === 'destroy') {
if (chosen instanceof JoomlaChosen) {
chosen.destroy();
}
return;
}
if (!(chosen instanceof JoomlaChosen)) {
$this.data('chosen', new JoomlaChosen(this, options));
}
});
};
JoomlaChosen = (function (_super) {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
__extends(JoomlaChosen, _super);
function JoomlaChosen() {
_ref = JoomlaChosen.__super__.constructor.apply(this, arguments);
return _ref;
}
JoomlaChosen.prototype.setup = function () {
var return_value;
return_value = JoomlaChosen.__super__.setup.apply(this, arguments);
this.allow_custom_value = this.form_field_jq.hasClass("chosen-custom-value") || this.options.allow_custom_value;
this.custom_value_prefix = this.form_field_jq.attr("data-custom_value_prefix") || this.custom_value_prefix;
return return_value;
};
JoomlaChosen.prototype.set_default_text = function () {
this.custom_group_text = this.form_field.getAttribute("data-custom_group_text") || this.options.custom_group_text || "Custom Value";
return JoomlaChosen.__super__.set_default_text.apply(this, arguments);
};
JoomlaChosen.prototype.result_select = function (evt) {
var group, option, value;
if (!this.result_highlight && (!this.is_multiple) && this.allow_custom_value) {
value = this.search_field.val();
group = this.add_unique_custom_group();
option = $('<option value="' + this.custom_value_prefix + value + '">' + value + '</option>');
group.append(option);
this.form_field_jq.append(group);
this.form_field.options[this.form_field.options.length - 1].selected = true;
if (!evt.metaKey) {
this.results_hide();
}
return this.results_build();
}
return JoomlaChosen.__super__.result_select.apply(this, arguments);
};
JoomlaChosen.prototype.find_custom_group = function () {
var found, group, _i, _len, _ref;
_ref = $('optgroup', this.form_field);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
group = _ref[_i];
if (group.getAttribute('label') === this.custom_group_text) {
found = group;
}
}
return found;
};
JoomlaChosen.prototype.add_unique_custom_group = function () {
var group;
group = this.find_custom_group();
if (!group) {
group = $('<optgroup label="' + this.custom_group_text + '"></optgroup>');
}
return $(group);
};
/**
* We choose to override this function so deliberately don't call super
*/
JoomlaChosen.prototype.container_width = function () {
if (this.options.width != null) {
return this.options.width;
} else {
// Original: return "" + this.form_field.offsetWidth + "px";
return this.form_field_jq.css("width") || "" + this.form_field.offsetWidth + "px";
}
};
return JoomlaChosen;
})(Chosen);
})(jQuery, document.Chosen, document.AbstractChosen);

1
media/legacy/js/joomla-chosen.min.js vendored Normal file
View File

@ -0,0 +1 @@
(function(u,f,h){u.fn.jchosen=function(_){return h.browser_is_supported()?this.each(function(p){var i,o;if(i=u(this),o=i.data("chosen"),_==="destroy"){o instanceof JoomlaChosen&&o.destroy();return}o instanceof JoomlaChosen||i.data("chosen",new JoomlaChosen(this,_))}):this},JoomlaChosen=function(_){var p={}.hasOwnProperty,i=function(t,e){for(var s in e)p.call(e,s)&&(t[s]=e[s]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};i(o,_);function o(){return _ref=o.__super__.constructor.apply(this,arguments),_ref}return o.prototype.setup=function(){var t;return t=o.__super__.setup.apply(this,arguments),this.allow_custom_value=this.form_field_jq.hasClass("chosen-custom-value")||this.options.allow_custom_value,this.custom_value_prefix=this.form_field_jq.attr("data-custom_value_prefix")||this.custom_value_prefix,t},o.prototype.set_default_text=function(){return this.custom_group_text=this.form_field.getAttribute("data-custom_group_text")||this.options.custom_group_text||"Custom Value",o.__super__.set_default_text.apply(this,arguments)},o.prototype.result_select=function(t){var e,s,r;return!this.result_highlight&&!this.is_multiple&&this.allow_custom_value?(r=this.search_field.val(),e=this.add_unique_custom_group(),s=u('<option value="'+this.custom_value_prefix+r+'">'+r+"</option>"),e.append(s),this.form_field_jq.append(e),this.form_field.options[this.form_field.options.length-1].selected=!0,t.metaKey||this.results_hide(),this.results_build()):o.__super__.result_select.apply(this,arguments)},o.prototype.find_custom_group=function(){var t,e,s,r,n;for(n=u("optgroup",this.form_field),s=0,r=n.length;s<r;s++)e=n[s],e.getAttribute("label")===this.custom_group_text&&(t=e);return t},o.prototype.add_unique_custom_group=function(){var t;return t=this.find_custom_group(),t||(t=u('<optgroup label="'+this.custom_group_text+'"></optgroup>')),u(t)},o.prototype.container_width=function(){return this.options.width!=null?this.options.width:this.form_field_jq.css("width")||""+this.form_field.offsetWidth+"px"},o}(f)})(jQuery,document.Chosen,document.AbstractChosen);

Binary file not shown.

1
media/legacy/js/jquery-noconflict.js vendored Normal file
View File

@ -0,0 +1 @@
var $ = jQuery.noConflict();

View File

@ -0,0 +1 @@
var $=jQuery.noConflict();

Binary file not shown.

View File

@ -0,0 +1,240 @@
/**
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* JavaScript behavior to allow selected tab to be remembered after save or page reload
* keeping state in sessionStorage with better handling of multiple tab widgets per page
* and not saving the state if there is no id in the url (like on the CREATE page of content)
*/
jQuery(function ($) {
/**
* Tiny jQuery extension to allow getting of url params
* @use jQuery.urlParam('param') or $.urlParam('myRegex|anotherRegex')
* If no trailing equals sign in name, add one, allows for general reuse
*/
$.urlParam = function (name) {
if (!new RegExp("=$").exec(name)) {
name = name + '=';
}
var results = new RegExp("[\\?&](" + name + ")([^&#]*)").exec(window.location.href);
return results ? results[1] : null;
};
// jQuery extension to get the XPATH of a DOM element
$.getXpath = function (el) {
if (typeof el == "string") {
return document.evaluate(el, document, null, 0, null);
}
if (!el || el.nodeType != 1) {
return "";
}
if (el.id) {
return "//*[@id='" + el.id + "']";
}
var a = [];
var sames = a.filter.call(el.parentNode.children, function (x) {
return x.tagName == el.tagName;
});
var b = [];
return $.getXpath(el.parentNode) + "/" + el.tagName.toLowerCase() + (sames.length > 1 ? "[" + (b.indexOf.call(sames, el) + 1) + "]" : "");
};
// jQuery extension to get the DOM element from an XPATH
$.findXpath = function (exp, ctxt) {
var item;
var coll = [];
var result = document.evaluate(exp, ctxt || document, null, 5, null);
while (item = result.iterateNext()) {
coll.push(item);
}
return $(coll);
};
var loadTabs = function () {
/**
* Remove an item from an array
*/
function remove_item(activeTabsHrefs, tabCollection) {
for (var i = 0; i < activeTabsHrefs.length; i++) {
if (activeTabsHrefs[i].indexOf(tabCollection) > -1) {
activeTabsHrefs.splice(i, 1);
}
}
return activeTabsHrefs;
}
/**
* Generate the sessionStorage key we will use
* This is the URL minus some cleanup
*/
function getStorageKey() {
return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/, "").split('#')[0];
}
/**
* Save this tab to the storage in the form of a pseudo keyed array
*/
function saveActiveTab(event) {
if (!window.sessionStorage) {
return;
}
// Get a new storage key, normally the full url we are on with some cleanup
var storageKey = getStorageKey();
// get this tabs own href
var href = $(event.target).attr("href");
// find the collection of tabs this tab belongs to, and calculate the unique xpath to it
var tabCollection = $.getXpath($(event.target).closest(".nav-tabs").first().get(0));
// error handling
if (!tabCollection || typeof href == "undefined") {
return;
}
// Create a dummy keyed array as js doesnt allow keyed arrays
var storageValue = tabCollection + "|" + href;
// Get the current array from the storage
var activeTabsHrefs = JSON.parse(sessionStorage.getItem(storageKey));
// If none start a new array
if (!activeTabsHrefs) {
var activeTabsHrefs = [];
} else {
// Avoid Duplicates in the storage
remove_item(activeTabsHrefs, tabCollection);
}
// Save clicked tab, with relationship to tabCollection to the array
activeTabsHrefs.push(storageValue);
// Store the selected tabs as an array in sessionStorage
sessionStorage.setItem(storageKey, JSON.stringify(activeTabsHrefs));
}
// Array with active tabs hrefs
var activeTabsHrefs = JSON.parse(sessionStorage.getItem(getStorageKey()));
// jQuery object with all tabs links
var alltabs = $("a[data-bs-toggle='tab']");
// When a tab is clicked, save its state!
alltabs.on("click", function (e) {
saveActiveTab(e);
});
// Clean default tabs
alltabs.parent(".active").removeClass("active");
// If we cannot find a tab storage for this url, see if we are coming from a save of a new item
if (!activeTabsHrefs) {
var unSavedStateUrl = getStorageKey().replace(/\&id=[0-9]*|[a-z]\&{1}_id=[0-9]*/, '');
activeTabsHrefs = JSON.parse(sessionStorage.getItem(unSavedStateUrl));
sessionStorage.removeItem(unSavedStateUrl);
}
// we have some tab states to restore, if we see a hash then let that trump the saved state
if (activeTabsHrefs !== null && !window.location.hash) {
// When moving from tab area to a different view
$.each(activeTabsHrefs, function (index, tabFakexPath) {
// Click the tab
var parts = tabFakexPath.split("|");
$.findXpath(parts[0]).find("a[data-bs-toggle='tab'][href='" + parts[1] + "']").get(0).click();
});
} else { // clean slate start
// a list of tabs to click
var tabsToClick = [];
// If we are passing a hash then this trumps everything
if (window.location.hash) {
// for each set of tabs on the page
alltabs.parents("ul").each(function (index, ul) {
// If no tabs is saved, activate first tab from each tab set and save it
var tabToClick = $(ul).find("a[href='" + window.location.hash + "']");
// If we found some|one
if (tabToClick.length) {
// if we managed to locate its selector directly
if (tabToClick.selector) {
// highlight tab of the tabs if the hash matches
tabsToClick.push(tabToClick);
} else {
// highlight first tab of the tabs
tabsToClick.push(tabToClick.first());
}
var parentPane = tabToClick.closest('.tab-pane');
// bubble up for nested tabs (like permissions tabs in the permissions pane)
if (parentPane) {
var id = parentPane.attr('id');
if (id) {
var parentTabToClick = $(parentPane).find("a[href='#" + id + "']");
if (parentTabToClick) {
tabsToClick.push(parentTabToClick);
}
}
}
}
// cleanup for another loop
parentTabToClick = null;
tabToClick = null;
parentPane = null;
id = null;
});
// run in the right order bubbling up
tabsToClick.reverse();
// for all queued tabs
for (var i = 0; i < tabsToClick.length; i++) {
// click the tabs, thus storing them
jQuery(tabsToClick[i].selector).click();
}
// Remove the #hash in the url - with support for older browsers with no flicker
var scrollV, scrollH, loc = window.location;
if ("pushState" in history)
history.pushState("", document.title, loc.pathname + loc.search);
else {
// Prevent scrolling by storing the page's current scroll offset
scrollV = document.body.scrollTop;
scrollH = document.body.scrollLeft;
loc.hash = "";
// Restore the scroll offset, should be flicker free
document.body.scrollTop = scrollV;
document.body.scrollLeft = scrollH;
}
} else {
alltabs.parents("ul").each(function (index, ul) {
// If no tabs is saved, activate first tab from each tab set and save it
$(ul).find("a").first().click();
});
}
}
};
setTimeout(loadTabs, 100);
});

4
media/legacy/js/tabs-state.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/**
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/jQuery(function(r){r.urlParam=function(e){new RegExp("=$").exec(e)||(e=e+"=");var n=new RegExp("[\\?&]("+e+")([^&#]*)").exec(window.location.href);return n?n[1]:null},r.getXpath=function(e){if(typeof e=="string")return document.evaluate(e,document,null,0,null);if(!e||e.nodeType!=1)return"";if(e.id)return"//*[@id='"+e.id+"']";var n=[],f=n.filter.call(e.parentNode.children,function(u){return u.tagName==e.tagName}),i=[];return r.getXpath(e.parentNode)+"/"+e.tagName.toLowerCase()+(f.length>1?"["+(i.indexOf.call(f,e)+1)+"]":"")},r.findXpath=function(e,n){for(var f,i=[],u=document.evaluate(e,n||document,null,5,null);f=u.iterateNext();)i.push(f);return r(i)};var w=function(){function e(a,o){for(var t=0;t<a.length;t++)a[t].indexOf(o)>-1&&a.splice(t,1);return a}function n(){return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/,"").split("#")[0]}function f(a){if(window.sessionStorage){var o=n(),t=r(a.target).attr("href"),l=r.getXpath(r(a.target).closest(".nav-tabs").first().get(0));if(!(!l||typeof t>"u")){var d=l+"|"+t,s=JSON.parse(sessionStorage.getItem(o));if(s)e(s,l);else var s=[];s.push(d),sessionStorage.setItem(o,JSON.stringify(s))}}}var i=JSON.parse(sessionStorage.getItem(n())),u=r("a[data-bs-toggle='tab']");if(u.on("click",function(a){f(a)}),u.parent(".active").removeClass("active"),!i){var v=n().replace(/\&id=[0-9]*|[a-z]\&{1}_id=[0-9]*/,"");i=JSON.parse(sessionStorage.getItem(v)),sessionStorage.removeItem(v)}if(i!==null&&!window.location.hash)r.each(i,function(a,o){var t=o.split("|");r.findXpath(t[0]).find("a[data-bs-toggle='tab'][href='"+t[1]+"']").get(0).click()});else{var c=[];if(window.location.hash){u.parents("ul").each(function(a,o){var t=r(o).find("a[href='"+window.location.hash+"']");if(t.length){t.selector?c.push(t):c.push(t.first());var l=t.closest(".tab-pane");if(l){var d=l.attr("id");if(d){var s=r(l).find("a[href='#"+d+"']");s&&c.push(s)}}}s=null,t=null,l=null,d=null}),c.reverse();for(var h=0;h<c.length;h++)jQuery(c[h].selector).click();var p,m,g=window.location;"pushState"in history?history.pushState("",document.title,g.pathname+g.search):(p=document.body.scrollTop,m=document.body.scrollLeft,g.hash="",document.body.scrollTop=p,document.body.scrollLeft=m)}else u.parents("ul").each(function(a,o){r(o).find("a").first().click()})}};setTimeout(w,100)});

Binary file not shown.

View File

@ -0,0 +1,67 @@
/**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
(function (Joomla, document) {
'use strict';
/**
* USED IN: libraries/joomla/html/toolbar/button/help.php
*
* Pops up a new window in the middle of the screen
*
* @param {string} mypage The URL for the redirect
* @param {string} myname The name of the page
* @param {int} w The width of the new window
* @param {int} h The height of the new window
* @param {string} scroll The vertical/horizontal scroll bars
*
* @since 4.0.0
*
* @deprecated 4.3 will be removed in 6.0
* Will be removed without replacement. Use browser native call instead
*/
Joomla.popupWindow = function (mypage, myname, w, h, scroll) {
const winl = (screen.width - w) / 2;
const wint = (screen.height - h) / 2;
const winprops = `height=${h},width=${w},top=${wint},left=${winl},scrollbars=${scroll},resizable`;
window.open(mypage, myname, winprops).window.focus();
};
document.addEventListener('DOMContentLoaded', () => {
/**
* Fix the alignment of the Options and Help toolbar buttons
*/
const toolbarOptions = document.getElementById('toolbar-options');
const toolbarHelp = document.getElementById('toolbar-help');
const toolbarInlineHelp = document.getElementById('toolbar-inlinehelp');
// Handle Help buttons
document.querySelectorAll('.js-toolbar-help-btn').forEach((button) => {
button.addEventListener('click', (event) => {
const btn = event.currentTarget;
const winprops = `height=${parseInt(btn.dataset.height, 10)},width=${parseInt(btn.dataset.width, 10)},top=${(window.innerHeight - parseInt(btn.dataset.height, 10)) / 2},`
+ `left=${(window.innerWidth - parseInt(btn.dataset.width, 10)) / 2},scrollbars=${btn.dataset.width === 'true'},resizable`;
window.open(btn.dataset.url, btn.dataset.tile, winprops).window.focus();
});
});
if (toolbarInlineHelp) {
toolbarInlineHelp.classList.add('ms-auto');
return;
}
if (toolbarHelp && !toolbarOptions) {
toolbarHelp.classList.add('ms-auto');
}
if (toolbarOptions && !toolbarHelp) {
toolbarOptions.classList.add('ms-auto');
}
});
}(Joomla, document));

4
media/legacy/js/toolbar.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla=window.Joomla||{},function(r,e){"use strict";r.popupWindow=function(o,n,s,i,a){const t=(screen.width-s)/2,l=(screen.height-i)/2,d=`height=${i},width=${s},top=${l},left=${t},scrollbars=${a},resizable`;window.open(o,n,d).window.focus()},e.addEventListener("DOMContentLoaded",()=>{const o=e.getElementById("toolbar-options"),n=e.getElementById("toolbar-help"),s=e.getElementById("toolbar-inlinehelp");if(e.querySelectorAll(".js-toolbar-help-btn").forEach(i=>{i.addEventListener("click",a=>{const t=a.currentTarget,l=`height=${parseInt(t.dataset.height,10)},width=${parseInt(t.dataset.width,10)},top=${(window.innerHeight-parseInt(t.dataset.height,10))/2},left=${(window.innerWidth-parseInt(t.dataset.width,10))/2},scrollbars=${t.dataset.width==="true"},resizable`;window.open(t.dataset.url,t.dataset.tile,l).window.focus()})}),s){s.classList.add("ms-auto");return}n&&!o&&n.classList.add("ms-auto"),o&&!n&&o.classList.add("ms-auto")})}(Joomla,document);

Binary file not shown.

View File

@ -0,0 +1,145 @@
/**
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
jQuery(function($)
{
var treeselectmenu = $('div#treeselectmenu').html();
var direction = (document.dir !== undefined) ? document.dir : document.getElementsByTagName("html")[0].getAttribute("dir");
$('.treeselect li').each(function()
{
$li = $(this);
$div = $li.find('div.treeselect-item:first');
// Add icons
$li.prepend('<span class="icon-"></span>');
if ($li.find('ul.treeselect-sub').length) {
// Add classes to Expand/Collapse icons
$li.find('span.icon-').addClass('treeselect-toggle icon-chevron-down');
// Append drop down menu in nodes
$div.find('label:first').after(treeselectmenu);
if (!$li.find('ul.treeselect-sub ul.treeselect-sub').length) {
$li.find('div.treeselect-menu-expand').remove();
}
}
});
// Takes care of the Expand/Collapse of a node
$('span.treeselect-toggle').click(function()
{
$i = $(this);
if (direction === 'rtl') {
var chevron = 'icon-chevron-left';
} else {
var chevron = 'icon-chevron-right';
}
// Take care of parent UL
if ($i.parent().find('ul.treeselect-sub').is(':visible')) {
$i.removeClass('icon-chevron-down').addClass(chevron);
$i.parent().find('ul.treeselect-sub').hide();
$i.parent().find('ul.treeselect-sub i.treeselect-toggle').removeClass('icon-chevron-down').addClass(chevron);
} else {
$i.removeClass(chevron).addClass('icon-chevron-down');
$i.parent().find('ul.treeselect-sub').show();
$i.parent().find('ul.treeselect-sub i.treeselect-toggle').removeClass(chevron).addClass('icon-chevron-down');
}
});
// Takes care of the filtering
$('#treeselectfilter').keyup(function()
{
var text = $(this).val().toLowerCase();
var hidden = 0;
$("#noresultsfound").hide();
var $list_elements = $('.treeselect li');
$list_elements.each(function()
{
if ($(this).text().toLowerCase().indexOf(text) == -1) {
$(this).hide();
hidden++;
}
else {
$(this).show();
}
});
if(hidden == $list_elements.length)
{
$("#noresultsfound").show();
}
});
// Checks all checkboxes the tree
$('#treeCheckAll').click(function()
{
$('.treeselect input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', true);
}
});
});
// Unchecks all checkboxes the tree
$('#treeUncheckAll').click(function()
{
$('.treeselect input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', false);
}
});
});
// Checks all checkboxes the tree
$('#treeExpandAll').click(function()
{
$('ul.treeselect ul.treeselect-sub').show();
$('ul.treeselect span.treeselect-toggle').removeClass('icon-chevron-right').addClass('icon-chevron-down');
});
// Unchecks all checkboxes the tree
$('#treeCollapseAll').click(function()
{
$('ul.treeselect ul.treeselect-sub').hide();
$('ul.treeselect span.treeselect-toggle').removeClass('icon-chevron-down').addClass('icon-chevron-right');
});
// Take care of children check/uncheck all
$('a.checkall').click(function()
{
$(this).parents().eq(4).find('input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', true);
}
});
});
$('a.uncheckall').click(function()
{
$(this).parents().eq(4).find('input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', false);
}
});
});
// Take care of children toggle all
$('a.expandall').click(function()
{
var $parent = $(this).parents().eq(6);
$parent.find('ul.treeselect-sub').show();
$parent.find('ul.treeselect-sub i.treeselect-toggle').removeClass('icon-chevron-right').addClass('icon-chevron-down');
});
$('a.collapseall').click(function()
{
var $parent = $(this).parents().eq(6);
$parent.find('li ul.treeselect-sub').hide();
$parent.find('li i.treeselect-toggle').removeClass('icon-chevron-down').addClass('icon-chevron-right');
});
});

4
media/legacy/js/treeselectmenu.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/**
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/jQuery(function(e){var s=e("div#treeselectmenu").html(),n=document.dir!==void 0?document.dir:document.getElementsByTagName("html")[0].getAttribute("dir");e(".treeselect li").each(function(){$li=e(this),$div=$li.find("div.treeselect-item:first"),$li.prepend('<span class="icon-"></span>'),$li.find("ul.treeselect-sub").length&&($li.find("span.icon-").addClass("treeselect-toggle icon-chevron-down"),$div.find("label:first").after(s),$li.find("ul.treeselect-sub ul.treeselect-sub").length||$li.find("div.treeselect-menu-expand").remove())}),e("span.treeselect-toggle").click(function(){if($i=e(this),n==="rtl")var t="icon-chevron-left";else var t="icon-chevron-right";$i.parent().find("ul.treeselect-sub").is(":visible")?($i.removeClass("icon-chevron-down").addClass(t),$i.parent().find("ul.treeselect-sub").hide(),$i.parent().find("ul.treeselect-sub i.treeselect-toggle").removeClass("icon-chevron-down").addClass(t)):($i.removeClass(t).addClass("icon-chevron-down"),$i.parent().find("ul.treeselect-sub").show(),$i.parent().find("ul.treeselect-sub i.treeselect-toggle").removeClass(t).addClass("icon-chevron-down"))}),e("#treeselectfilter").keyup(function(){var t=e(this).val().toLowerCase(),i=0;e("#noresultsfound").hide();var l=e(".treeselect li");l.each(function(){e(this).text().toLowerCase().indexOf(t)==-1?(e(this).hide(),i++):e(this).show()}),i==l.length&&e("#noresultsfound").show()}),e("#treeCheckAll").click(function(){e(".treeselect input").each(function(){var t=e(this);t.prop("disabled")||t.prop("checked",!0)})}),e("#treeUncheckAll").click(function(){e(".treeselect input").each(function(){var t=e(this);t.prop("disabled")||t.prop("checked",!1)})}),e("#treeExpandAll").click(function(){e("ul.treeselect ul.treeselect-sub").show(),e("ul.treeselect span.treeselect-toggle").removeClass("icon-chevron-right").addClass("icon-chevron-down")}),e("#treeCollapseAll").click(function(){e("ul.treeselect ul.treeselect-sub").hide(),e("ul.treeselect span.treeselect-toggle").removeClass("icon-chevron-down").addClass("icon-chevron-right")}),e("a.checkall").click(function(){e(this).parents().eq(4).find("input").each(function(){var t=e(this);t.prop("disabled")||t.prop("checked",!0)})}),e("a.uncheckall").click(function(){e(this).parents().eq(4).find("input").each(function(){var t=e(this);t.prop("disabled")||t.prop("checked",!1)})}),e("a.expandall").click(function(){var t=e(this).parents().eq(6);t.find("ul.treeselect-sub").show(),t.find("ul.treeselect-sub i.treeselect-toggle").removeClass("icon-chevron-right").addClass("icon-chevron-down")}),e("a.collapseall").click(function(){var t=e(this).parents().eq(6);t.find("li ul.treeselect-sub").hide(),t.find("li i.treeselect-toggle").removeClass("icon-chevron-down").addClass("icon-chevron-right")})});

Binary file not shown.