first commit
This commit is contained in:
30
media/legacy/joomla.asset.json
Normal file
30
media/legacy/joomla.asset.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
|
||||
"name": "joomla",
|
||||
"version": "4.0.0",
|
||||
"description": "Joomla CMS",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"assets": [
|
||||
{
|
||||
"name": "jquery-noconflict",
|
||||
"type": "script",
|
||||
"dependencies": [
|
||||
"jquery"
|
||||
],
|
||||
"uri": "legacy/jquery-noconflict.min.js",
|
||||
"version": "4784e5"
|
||||
},
|
||||
{
|
||||
"name": "joomla.treeselectmenu",
|
||||
"type": "script",
|
||||
"dependencies": [
|
||||
"jquery"
|
||||
],
|
||||
"uri": "legacy/treeselectmenu.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"version": "e5cbd2"
|
||||
}
|
||||
]
|
||||
}
|
||||
161
media/legacy/js/ajax-chosen.js
Normal file
161
media/legacy/js/ajax-chosen.js
Normal 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;
|
||||
});
|
||||
}
|
||||
});
|
||||
1
media/legacy/js/ajax-chosen.min.js
vendored
Normal file
1
media/legacy/js/ajax-chosen.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(e){e.fn.ajaxChosen=function(t,n,a){var r,o,i,l;return null==t&&(t={}),null==n&&(n={}),null==a&&(a=function(){}),o={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term",keepTypingMsg:Joomla.Text._("JGLOBAL_KEEP_TYPING"),lookingForMsg:Joomla.Text._("JGLOBAL_LOOKING_FOR")},l=this,r=null,i=e.extend({},o,e(l).data(),t),this.jchosen(a||{}),this.each((function(){return e(this).next(".chosen-container").find(".search-field > input, .chosen-search > input").bind("keyup",(function(){var t,a,o,s,u;return s=e(this).val(),a=(u=e.trim(e(this).val())).length<i.minTermLength?i.keepTypingMsg:i.lookingForMsg+" '"+u+"'",l.next(".chosen-container").find(".no-results").text(a),u!==e(this).data("prevVal")&&(e(this).data("prevVal",u),this.timer&&clearTimeout(this.timer),!(u.length<i.minTermLength)&&(t=e(this),null==i.data&&(i.data={}),i.data[i.jsonTermKey]=u,null!=i.dataCallback&&(i.data=i.dataCallback(i.data)),o=i.success,i.success=function(a){var r,i,u;if(null!=a)return u=[],l.find("option").each((function(){return e(this).is(":selected")?u.push(e(this).val()+"-"+e(this).text()):e(this).remove()})),l.find("optgroup:empty").each((function(){return e(this).remove()})),r=n.apply(null,a),i=0,e.each(r,(function(t,n){var a,r,o;return i++,n.group?((a=l.find("optgroup[label='"+n.text+"']")).size()||(a=e("<optgroup />")),a.attr("label",n.text).appendTo(l),e.each(n.items,(function(t,n){var r,o;if("string"==typeof n?(o=t,r=n):(o=n.value,r=n.text),-1===e.inArray(o+"-"+r,u))return e("<option />").attr("value",o).html(r).appendTo(a)}))):("string"==typeof n?(o=t,r=n):(o=n.value,r=n.text),-1===e.inArray(o+"-"+r,u)?e("<option />").attr("value",o).html(r).appendTo(l):void 0)})),i?l.trigger("chosen:updated"):(l.data().jchosen.no_results_clear(),l.data().jchosen.no_results(t.val())),null!=o&&o(a),t.val(s)},this.timer=setTimeout((function(){return r&&r.abort(),r=e.ajax(i)}),i.afterTypeDelay)))}))}))}}(jQuery),jQuery(document).ready((function(e){if(Joomla.getOptions("ajax-chosen")){var t=Joomla.getOptions("ajax-chosen");e(t.selector).ajaxChosen({type:t.type,url:t.url,dataType:t.dataType,jsonTermKey:t.jsonTermKey,afterTypeDelay:t.afterTypeDelay,minTermLength:t.minTermLength},(function(t){var n=[];return e.each(t,(function(e,t){n.push({value:t.value,text:t.text})})),n}))}}));
|
||||
BIN
media/legacy/js/ajax-chosen.min.js.gz
Normal file
BIN
media/legacy/js/ajax-chosen.min.js.gz
Normal file
Binary file not shown.
102
media/legacy/js/joomla-chosen.js
Normal file
102
media/legacy/js/joomla-chosen.js
Normal 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
1
media/legacy/js/joomla-chosen.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(t,o,e){t.fn.jchosen=function(o){return e.browser_is_supported()?this.each((function(e){var s,i;i=(s=t(this)).data("chosen"),"destroy"!==o?i instanceof JoomlaChosen||s.data("chosen",new JoomlaChosen(this,o)):i instanceof JoomlaChosen&&i.destroy()})):this},JoomlaChosen=function(o){var e={}.hasOwnProperty;function s(){return _ref=s.__super__.constructor.apply(this,arguments),_ref}return function(t,o){for(var s in o)e.call(o,s)&&(t[s]=o[s]);function i(){this.constructor=t}i.prototype=o.prototype,t.prototype=new i,t.__super__=o.prototype}(s,o),s.prototype.setup=function(){var t;return t=s.__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},s.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",s.__super__.set_default_text.apply(this,arguments)},s.prototype.result_select=function(o){var e,i,r;return this.result_highlight||this.is_multiple||!this.allow_custom_value?s.__super__.result_select.apply(this,arguments):(r=this.search_field.val(),e=this.add_unique_custom_group(),i=t('<option value="'+this.custom_value_prefix+r+'">'+r+"</option>"),e.append(i),this.form_field_jq.append(e),this.form_field.options[this.form_field.options.length-1].selected=!0,o.metaKey||this.results_hide(),this.results_build())},s.prototype.find_custom_group=function(){var o,e,s,i,r;for(s=0,i=(r=t("optgroup",this.form_field)).length;s<i;s++)(e=r[s]).getAttribute("label")===this.custom_group_text&&(o=e);return o},s.prototype.add_unique_custom_group=function(){var o;return(o=this.find_custom_group())||(o=t('<optgroup label="'+this.custom_group_text+'"></optgroup>')),t(o)},s.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field_jq.css("width")||this.form_field.offsetWidth+"px"},s}(o)}(jQuery,document.Chosen,document.AbstractChosen);
|
||||
BIN
media/legacy/js/joomla-chosen.min.js.gz
Normal file
BIN
media/legacy/js/joomla-chosen.min.js.gz
Normal file
Binary file not shown.
1
media/legacy/js/jquery-noconflict.js
vendored
Normal file
1
media/legacy/js/jquery-noconflict.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var $ = jQuery.noConflict();
|
||||
1
media/legacy/js/jquery-noconflict.min.js
vendored
Normal file
1
media/legacy/js/jquery-noconflict.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var $=jQuery.noConflict();
|
||||
BIN
media/legacy/js/jquery-noconflict.min.js.gz
Normal file
BIN
media/legacy/js/jquery-noconflict.min.js.gz
Normal file
Binary file not shown.
240
media/legacy/js/tabs-state.js
Normal file
240
media/legacy/js/tabs-state.js
Normal 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);
|
||||
});
|
||||
1
media/legacy/js/tabs-state.min.js
vendored
Normal file
1
media/legacy/js/tabs-state.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery((function(e){e.urlParam=function(e){new RegExp("=$").exec(e)||(e+="=");var t=new RegExp("[\\?&]("+e+")([^&#]*)").exec(window.location.href);return t?t[1]:null},e.getXpath=function(t){if("string"==typeof t)return document.evaluate(t,document,null,0,null);if(!t||1!=t.nodeType)return"";if(t.id)return"//*[@id='"+t.id+"']";var n=[].filter.call(t.parentNode.children,(function(e){return e.tagName==t.tagName}));return e.getXpath(t.parentNode)+"/"+t.tagName.toLowerCase()+(n.length>1?"["+([].indexOf.call(n,t)+1)+"]":"")},e.findXpath=function(t,n){for(var a,r=[],o=document.evaluate(t,n||document,null,5,null);a=o.iterateNext();)r.push(a);return e(r)};setTimeout((function(){function t(){return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/,"").split("#")[0]}var n=JSON.parse(sessionStorage.getItem(t())),a=e("a[data-bs-toggle='tab']");if(a.on("click",(function(n){!function(n){if(window.sessionStorage){var a=t(),r=e(n.target).attr("href"),o=e.getXpath(e(n.target).closest(".nav-tabs").first().get(0));if(o&&void 0!==r){var i=o+"|"+r;if(l=JSON.parse(sessionStorage.getItem(a)))!function(e,t){for(var n=0;n<e.length;n++)e[n].indexOf(t)>-1&&e.splice(n,1)}(l,o);else var l=[];l.push(i),sessionStorage.setItem(a,JSON.stringify(l))}}}(n)})),a.parent(".active").removeClass("active"),!n){var r=t().replace(/\&id=[0-9]*|[a-z]\&{1}_id=[0-9]*/,"");n=JSON.parse(sessionStorage.getItem(r)),sessionStorage.removeItem(r)}if(null===n||window.location.hash){var o=[];if(window.location.hash){a.parents("ul").each((function(t,n){var a=e(n).find("a[href='"+window.location.hash+"']");if(a.length){a.selector?o.push(a):o.push(a.first());var r=a.closest(".tab-pane");if(r){var i=r.attr("id");if(i){var l=e(r).find("a[href='#"+i+"']");l&&o.push(l)}}}l=null,a=null,r=null,i=null})),o.reverse();for(var i=0;i<o.length;i++)jQuery(o[i].selector).click();var l,s,c=window.location;"pushState"in history?history.pushState("",document.title,c.pathname+c.search):(l=document.body.scrollTop,s=document.body.scrollLeft,c.hash="",document.body.scrollTop=l,document.body.scrollLeft=s)}else a.parents("ul").each((function(t,n){e(n).find("a").first().click()}))}else e.each(n,(function(t,n){var a=n.split("|");e.findXpath(a[0]).find("a[data-bs-toggle='tab'][href='"+a[1]+"']").get(0).click()}))}),100)}));
|
||||
BIN
media/legacy/js/tabs-state.min.js.gz
Normal file
BIN
media/legacy/js/tabs-state.min.js.gz
Normal file
Binary file not shown.
67
media/legacy/js/toolbar.js
Normal file
67
media/legacy/js/toolbar.js
Normal 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.target;
|
||||
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));
|
||||
1
media/legacy/js/toolbar.min.js
vendored
Normal file
1
media/legacy/js/toolbar.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
Joomla=window.Joomla||{},function(t,e){"use strict";t.popupWindow=function(t,e,o,a,s){const n=(screen.width-o)/2,d=`height=${a},width=${o},top=${(screen.height-a)/2},left=${n},scrollbars=${s},resizable`;window.open(t,e,d).window.focus()},e.addEventListener("DOMContentLoaded",(()=>{const t=e.getElementById("toolbar-options"),o=e.getElementById("toolbar-help"),a=e.getElementById("toolbar-inlinehelp");e.querySelectorAll(".js-toolbar-help-btn").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target,o=`height=${parseInt(e.dataset.height,10)},width=${parseInt(e.dataset.width,10)},top=${(window.innerHeight-parseInt(e.dataset.height,10))/2},left=${(window.innerWidth-parseInt(e.dataset.width,10))/2},scrollbars=${"true"===e.dataset.width},resizable`;window.open(e.dataset.url,e.dataset.tile,o).window.focus()}))})),a?a.classList.add("ms-auto"):(o&&!t&&o.classList.add("ms-auto"),t&&!o&&t.classList.add("ms-auto"))}))}(Joomla,document);
|
||||
BIN
media/legacy/js/toolbar.min.js.gz
Normal file
BIN
media/legacy/js/toolbar.min.js.gz
Normal file
Binary file not shown.
125
media/legacy/js/treeselectmenu.js
Normal file
125
media/legacy/js/treeselectmenu.js
Normal file
@ -0,0 +1,125 @@
|
||||
/**
|
||||
* @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').attr('checked', 'checked');
|
||||
});
|
||||
|
||||
// Unchecks all checkboxes the tree
|
||||
$('#treeUncheckAll').click(function()
|
||||
{
|
||||
$('.treeselect input').attr('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('ul.treeselect-sub input').attr('checked', 'checked');
|
||||
});
|
||||
$('a.uncheckall').click(function()
|
||||
{
|
||||
$(this).parents().eq(4).find('ul.treeselect-sub input').attr('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');
|
||||
});
|
||||
});
|
||||
1
media/legacy/js/treeselectmenu.min.js
vendored
Normal file
1
media/legacy/js/treeselectmenu.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery((function(e){var t=e("div#treeselectmenu").html(),l=void 0!==document.dir?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(t),$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),"rtl"===l)var t="icon-chevron-left";else 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(),l=0;e("#noresultsfound").hide();var s=e(".treeselect li");s.each((function(){-1==e(this).text().toLowerCase().indexOf(t)?(e(this).hide(),l++):e(this).show()})),l==s.length&&e("#noresultsfound").show()})),e("#treeCheckAll").click((function(){e(".treeselect input").attr("checked","checked")})),e("#treeUncheckAll").click((function(){e(".treeselect input").attr("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("ul.treeselect-sub input").attr("checked","checked")})),e("a.uncheckall").click((function(){e(this).parents().eq(4).find("ul.treeselect-sub input").attr("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")}))}));
|
||||
BIN
media/legacy/js/treeselectmenu.min.js.gz
Normal file
BIN
media/legacy/js/treeselectmenu.min.js.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user