User:Benwing2/common.js

Hello, you have come here looking for the meaning of the word User:Benwing2/common.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Benwing2/common.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Benwing2/common.js in singular and plural. Everything you need to know about the word User:Benwing2/common.js you have here. The definition of the word User:Benwing2/common.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Benwing2/common.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
importScript("User:Ioaxxere/minitoc.js");

// Various fixes for the trees generated by ].
$(function () {
	// Show the top toggle.
	$('.ft-toptoggle').css('display', '');
	
	var customtogglePrefix = 'ft';
	
	// Initialize the text of the toggles.
	$('.ftree').get().forEach(function (tree) {
		var isCollapsed = tree.classList.contains('mw-collapsed');
		var toggles = $(tree).find('.ft-toggle');
		if (toggles) {
			var customToggleClass = Array.prototype.filter.call(toggles.classList, function (className) {
				return className.indexOf('mw-customtoggle-' + customtogglePrefix) === 0;
			});
			if (customToggleClass) {
				var toggledElement = $('#' + customToggleClass.replace('mw-customtoggle', 'mw-customcollapsible'));
				if (toggledElement) {
					toggles.html(toggledElement.data(isCollapsed ? 'expandtext' : 'collapsetext'));
				}
			}
		}
	});
	
	// Change the text in the custom toggles generated by ]
	// when they are clicked.
	$('.mw-collapsible').on('beforeExpand.mw-collapsible beforeCollapse.mw-collapsible',
    function (event) {
        if (this.id.indexOf('mw-customcollapsible-' + customtogglePrefix) === 0) {
            var toggle = $('.' + this.id.replace('mw-customcollapsible', 'mw-customtoggle'));
            if (event.type === 'beforeExpand') {
                toggle.html(this.dataset.collapsetext);
            } else { // beforeCollapse
                toggle.html(this.dataset.expandtext);
            }
            event.stopPropagation();
        }
    });
});