X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/lib/amd/src
home
/
cbholdings
/
pasukulu
/
lib
/
amd
/
src
/
📁
..
📄
adapter.js
(123.08 KB)
📄
addblockmodal.js
(4.4 KB)
📄
ajax.js
(11.97 KB)
📄
aria.js
(1011 B)
📄
auto_rows.js
(3.46 KB)
📄
autoscroll.js
(6.49 KB)
📄
backoff_timer.js
(4.98 KB)
📄
chart_axis.js
(7.39 KB)
📄
chart_bar.js
(3.08 KB)
📄
chart_base.js
(11.36 KB)
📄
chart_builder.js
(1.65 KB)
📄
chart_line.js
(2.08 KB)
📄
chart_output.js
(1.08 KB)
📄
chart_output_base.js
(2.03 KB)
📄
chart_output_chartjs.js
(10.86 KB)
📄
chart_output_htmltable.js
(3.3 KB)
📄
chart_pie.js
(3.03 KB)
📄
chart_series.js
(8.35 KB)
📄
chartjs-lazy.js
(488.32 KB)
📄
chartjs.js
(913 B)
📄
checkbox-toggleall.js
(12.78 KB)
📄
config.js
(1002 B)
📄
copy_to_clipboard.js
(7.39 KB)
📄
custom_interaction_events.js
(22.18 KB)
📁
datafilter
📄
datafilter.js
(15.28 KB)
📄
dragdrop.js
(12.92 KB)
📄
drawer.js
(3.49 KB)
📄
drawer_events.js
(967 B)
📄
dynamic_tabs.js
(6.68 KB)
📄
edit_switch.js
(3.45 KB)
📁
emoji
📄
event.js
(3.11 KB)
📄
event_dispatcher.js
(2.79 KB)
📄
first.js
(1.36 KB)
📄
form-autocomplete.js
(51.21 KB)
📄
form-cohort-selector.js
(2.46 KB)
📄
form-course-selector.js
(3.77 KB)
📄
fragment.js
(5.03 KB)
📄
fullscreen.js
(1.62 KB)
📄
icon_system.js
(2.56 KB)
📄
icon_system_fontawesome.js
(4.01 KB)
📄
icon_system_standard.js
(2.3 KB)
📄
inplace_editable.js
(17.25 KB)
📄
key_codes.js
(1.34 KB)
📄
loadingicon.js
(3.88 KB)
📁
local
📄
localstorage.js
(2.08 KB)
📄
log.js
(1.74 KB)
📄
loglevel.js
(10.63 KB)
📄
menu_navigation.js
(9.2 KB)
📄
modal.js
(31.18 KB)
📄
modal_backdrop.js
(4.46 KB)
📄
modal_cancel.js
(1.49 KB)
📄
modal_copy_to_clipboard.js
(3.82 KB)
📄
modal_delete_cancel.js
(2.22 KB)
📄
modal_events.js
(1.35 KB)
📄
modal_factory.js
(8.97 KB)
📄
modal_registry.js
(2.38 KB)
📄
modal_save_cancel.js
(2.21 KB)
📁
moodlenet
📄
moremenu.js
(10.3 KB)
📄
mustache.js
(28.75 KB)
📄
network.js
(9.66 KB)
📄
normalise.js
(1.9 KB)
📄
notification.js
(11.8 KB)
📄
page_global.js
(5.38 KB)
📄
paged_content.js
(2.87 KB)
📄
paged_content_events.js
(1.17 KB)
📄
paged_content_factory.js
(20.93 KB)
📄
paged_content_pages.js
(11.75 KB)
📄
paged_content_paging_bar.js
(20.36 KB)
📄
paged_content_paging_bar_limit_selector.js
(2.36 KB)
📄
paged_content_paging_dropdown.js
(7.36 KB)
📄
pending.js
(4.48 KB)
📄
permissionmanager.js
(9.77 KB)
📄
popover_region_controller.js
(13.04 KB)
📄
popper.js
(79.2 KB)
📄
prefetch.js
(5.85 KB)
📄
process_monitor.js
(3.55 KB)
📄
pubsub.js
(2.17 KB)
📄
reactive.js
(1.38 KB)
📄
scroll_manager.js
(5.5 KB)
📄
sessionstorage.js
(2.22 KB)
📄
showhidesettings.js
(11.82 KB)
📄
sortable_list.js
(29.51 KB)
📄
sticky-footer.js
(2.58 KB)
📄
storagewrapper.js
(5.21 KB)
📄
str.js
(7.84 KB)
📄
tag.js
(19.84 KB)
📄
templates.js
(51.36 KB)
📄
toast.js
(3.32 KB)
📄
tooltip.js
(4.09 KB)
📄
tree.js
(18.39 KB)
📄
truncate.js
(6.56 KB)
📄
url.js
(3.65 KB)
📄
user_date.js
(9.32 KB)
📄
userfeedback.js
(2.91 KB)
📄
usermenu.js
(5.13 KB)
📄
utility.js
(6.15 KB)
📄
utils.js
(2.73 KB)
📄
yui.js
(1.13 KB)
Editing: showhidesettings.js
/** * Show/hide admin settings based on other settings selected * * @copyright 2018 Davo Smith, Synergy Learning * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define(['jquery'], function($) { var dependencies; // ------------------------------------------------- // Support functions, used by dependency functions. // ------------------------------------------------- /** * Check to see if the given element is the hidden element that makes sure checkbox * elements always submit a value. * @param {jQuery} $el * @returns {boolean} */ function isCheckboxHiddenElement($el) { return ($el.is('input[type=hidden]') && $el.siblings('input[type=checkbox][name="' + $el.attr('name') + '"]').length); } /** * Check to see if this is a radio button with the wrong value (i.e. a radio button from * the group we are interested in, but not the specific one we wanted). * @param {jQuery} $el * @param {string} value * @returns {boolean} */ function isWrongRadioButton($el, value) { return ($el.is('input[type=radio]') && $el.attr('value') !== value); } /** * Is this element relevant when we're looking for checked / not checked status? * @param {jQuery} $el * @param {string} value * @returns {boolean} */ function isCheckedRelevant($el, value) { return (!isCheckboxHiddenElement($el) && !isWrongRadioButton($el, value)); } /** * Is this an unchecked radio button? (If it is, we want to skip it, as * we're only interested in the value of the radio button that is checked) * @param {jQuery} $el * @returns {boolean} */ function isUncheckedRadioButton($el) { return ($el.is('input[type=radio]') && !$el.prop('checked')); } /** * Is this an unchecked checkbox? * @param {jQuery} $el * @returns {boolean} */ function isUncheckedCheckbox($el) { return ($el.is('input[type=checkbox]') && !$el.prop('checked')); } /** * Is this a multi-select select element? * @param {jQuery} $el * @returns {boolean} */ function isMultiSelect($el) { return ($el.is('select') && $el.prop('multiple')); } /** * Does the multi-select exactly match the list of values provided? * @param {jQuery} $el * @param {array} values * @returns {boolean} */ function multiSelectMatches($el, values) { var selected = $el.val() || []; if (!values.length) { // No values - nothing to match against. return false; } if (selected.length !== values.length) { // Different number of expected and actual values - cannot possibly be a match. return false; } for (var i in selected) { if (selected.hasOwnProperty(i)) { if (values.indexOf(selected[i]) === -1) { return false; // Found a non-matching value - give up immediately. } } } // Didn't find a non-matching value, so we have a match. return true; } // ------------------------------- // Specific dependency functions. // ------------------------------- var depFns = { notchecked: function($dependon, value) { var hide = false; value = String(value); $dependon.each(function(idx, el) { var $el = $(el); if (isCheckedRelevant($el, value)) { hide = hide || !$el.prop('checked'); } }); return hide; }, checked: function($dependon, value) { var hide = false; value = String(value); $dependon.each(function(idx, el) { var $el = $(el); if (isCheckedRelevant($el, value)) { hide = hide || $el.prop('checked'); } }); return hide; }, noitemselected: function($dependon) { var hide = false; $dependon.each(function(idx, el) { var $el = $(el); hide = hide || ($el.prop('selectedIndex') === -1); }); return hide; }, eq: function($dependon, value) { var hide = false; var hiddenVal = false; value = String(value); $dependon.each(function(idx, el) { var $el = $(el); if (isUncheckedRadioButton($el)) { // For radio buttons, we're only interested in the one that is checked. return; } if (isCheckboxHiddenElement($el)) { // This is the hidden input that is part of the checkbox setting. // We will use this value, if the associated checkbox is unchecked. hiddenVal = ($el.val() === value); return; } if (isUncheckedCheckbox($el)) { // Checkbox is not checked - hide depends on the 'unchecked' value stored in // the associated hidden element, which we have already found, above. hide = hide || hiddenVal; return; } if (isMultiSelect($el)) { // Expect a list of values to match, separated by '|' - all of them must // match the values selected. var values = value.split('|'); hide = multiSelectMatches($el, values); return; } // All other element types - just compare the value directly. hide = hide || ($el.val() === value); }); return hide; }, 'in': function($dependon, value) { var hide = false; var hiddenVal = false; var values = value.split('|'); $dependon.each(function(idx, el) { var $el = $(el); if (isUncheckedRadioButton($el)) { // For radio buttons, we're only interested in the one that is checked. return; } if (isCheckboxHiddenElement($el)) { // This is the hidden input that is part of the checkbox setting. // We will use this value, if the associated checkbox is unchecked. hiddenVal = (values.indexOf($el.val()) > -1); return; } if (isUncheckedCheckbox($el)) { // Checkbox is not checked - hide depends on the 'unchecked' value stored in // the associated hidden element, which we have already found, above. hide = hide || hiddenVal; return; } if (isMultiSelect($el)) { // For multiselect, we check to see if the list of values provided matches the list selected. hide = multiSelectMatches($el, values); return; } // All other element types - check to see if the value is in the list. hide = hide || (values.indexOf($el.val()) > -1); }); return hide; }, defaultCondition: function($dependon, value) { // Not equal. var hide = false; var hiddenVal = false; value = String(value); $dependon.each(function(idx, el) { var $el = $(el); if (isUncheckedRadioButton($el)) { // For radio buttons, we're only interested in the one that is checked. return; } if (isCheckboxHiddenElement($el)) { // This is the hidden input that is part of the checkbox setting. // We will use this value, if the associated checkbox is unchecked. hiddenVal = ($el.val() !== value); return; } if (isUncheckedCheckbox($el)) { // Checkbox is not checked - hide depends on the 'unchecked' value stored in // the associated hidden element, which we have already found, above. hide = hide || hiddenVal; return; } if (isMultiSelect($el)) { // Expect a list of values to match, separated by '|' - all of them must // match the values selected to *not* hide the element. var values = value.split('|'); hide = !multiSelectMatches($el, values); return; } // All other element types - just compare the value directly. hide = hide || ($el.val() !== value); }); return hide; } }; /** * Find the element with the given name * @param {String} name * @returns {*|jQuery|HTMLElement} */ function getElementsByName(name) { // For the array elements, we use [name^="something["] to find the elements that their name begins with 'something['/ // This is to find both name = 'something[]' and name='something[index]'. return $('[name="' + name + '"],[name^="' + name + '["]'); } /** * Check to see whether a particular condition is met * @param {*|jQuery|HTMLElement} $dependon * @param {String} condition * @param {mixed} value * @returns {Boolean} */ function checkDependency($dependon, condition, value) { if (typeof depFns[condition] === "function") { return depFns[condition]($dependon, value); } return depFns.defaultCondition($dependon, value); } /** * Show / hide the elements that depend on some elements. */ function updateDependencies() { // Process all dependency conditions. var toHide = {}; $.each(dependencies, function(dependonname) { var dependon = getElementsByName(dependonname); $.each(dependencies[dependonname], function(condition, values) { $.each(values, function(value, elements) { var hide = checkDependency(dependon, condition, value); $.each(elements, function(idx, elToHide) { if (toHide.hasOwnProperty(elToHide)) { toHide[elToHide] = toHide[elToHide] || hide; } else { toHide[elToHide] = hide; } }); }); }); }); // Update the hidden status of all relevant elements. $.each(toHide, function(elToHide, hide) { getElementsByName(elToHide).each(function(idx, el) { var $parent = $(el).closest('.form-item'); if ($parent.length) { if (hide) { $parent.hide(); } else { $parent.show(); } } }); }); } /** * Initialise the event handlers. */ function initHandlers() { $.each(dependencies, function(depname) { var $el = getElementsByName(depname); if ($el.length) { $el.on('change', updateDependencies); } }); updateDependencies(); } /** * Hide the 'this setting may be hidden' messages. */ function hideDependencyInfo() { $('.form-dependenton').hide(); } return { init: function(opts) { dependencies = opts.dependencies; initHandlers(); hideDependencyInfo(); } }; });
Upload File
Create Folder