User:Erutuon/common.js

Hello, you have come here looking for the meaning of the word User:Erutuon/common.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Erutuon/common.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Erutuon/common.js in singular and plural. Everything you need to know about the word User:Erutuon/common.js you have here. The definition of the word User:Erutuon/common.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Erutuon/common.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
// <nowiki>
// See also ].
/* jshint maxerr: 250, moz: true */

if (mw.config.get('wgNamespaceNumber') === 14 && /^{2,3}(?:-{2,3})*$/.test(mw.config.get('wgTitle'))) {
	importScript('User:Erutuon/scripts/langCatRedirect.js');
}

(function () {

var mwvalues  = mw.config.values;
if (!mwvalues) throw new TypeError("mwvalues is undefined");
var namespace = mwvalues.wgFormattedNamespaces;
var pageName  = mwvalues.wgPageName;
var contentModel = mw.config.get('wgPageContentModel');

window.loadWikipediaScript = function (pageName) {
	mw.loader.load('//en.wikipedia.orghttps://en.wiktionary.org/w/index.php?title=' + pageName + '&action=raw&ctype=text/javascript');
};

window.withScript = function (pageName, successCallback, failureCallback) {
	return $.getScript('//en.wiktionary.orghttps://en.wiktionary.org/w/index.php?title=' + encodeURIComponent(pageName)
		+ '&action=raw&ctype=text/javascript')
		.done(successCallback)
		.fail(failureCallback);
};

window.copyWikitext = function copyWikitext(title) {
	window.withScript('User:Erutuon/scripts/apiWrapper.js', function() {
		apiWrapper.getWikitext(title, function(wikitext) {
			$('#wpTextbox1').textSelection('setContents', wikitext);
			$('#wpSummary').val('copy of ]");
		});
	});
};

function makeShowHideButton(toHide, precedingElement) {
	mw.loader.using("oojs-ui").done(function () {
		const button = new OO.ui.ButtonWidget();
		var shown = false;
		button.updateLabel = function() {
			this.setLabel(shown ? hideText : showText);
		};
		
		const hideText = 'Hide words with entries',
			showText = 'Show words with entries';
		
		precedingElement.before(button.$element);
		
		toHide.toggle(shown);
		button.updateLabel();
		
		button.$element.click(function () {
			shown = !shown;
			toHide.toggle(shown);
			button.updateLabel();
		});
	});
}

/* Scripts running only on specific pages */
switch (pageName) {
	case 'Special:WantedCategories': case 'Special:WantedTemplates':
		importScript('User:Erutuon/scripts/hideUnwantedCategories.js'); //Linkback: ] Added by Script installer
		break;
	case 'Special:Search': {
		// Add button to retrieve list of titles from search results.
		mw.loader.using("oojs-ui").done(function () {
			const button = new OO.ui.ButtonWidget();
	
			const getSearchResultTitles = function () {
				return $(".mw-search-result-heading a").get().map(function (e) {
					return e.textContent;
				});
			};
	
			button.setLabel("Extract list of titles from search results");
	
			button.$element.click(function() {
				const titles = getSearchResultTitles();
				const pre = $("<pre>").text(titles.join("\n")).css("clear", "both");
				button.$element.replaceWith(pre);
			});
	
			$(".results-info").after($("<div>").append(button.$element));
		});
		break;
	}
	case 'MediaWiki:Gadgets-definition':
		importScript('User:Erutuon/scripts/gadgets-definition.js');
		break;
	case 'User:Erutuon/Odyssey_list':
	case 'User:Erutuon/Odyssey_list_(5-3)':
	case 'User:Erutuon/Odyssey_twice-used_list':
	case 'User:Erutuon/Odyssey_nonce_list': {
		const $hasEntry = $('.mw-parser-output li').has(' a');
		makeShowHideButton($hasEntry, $hasEntry.first().parent());
		break;
	}
	case 'User:Erutuon/Thucydides_words': {
		const $tableRows = $('.mw-parser-output tr').has('td');
		const $withRedLink = $tableRows.not($tableRows.has('.new'));
		makeShowHideButton($withRedLink, $withRedLink.closest('table'));
		break;
	}
	case 'User:Erutuon/Classical_Greek_prose': {
		const $hasEntry = $('.mw-parser-output ul li')
			.filter(function (_, li) {
				const span = li.firstChild;
				return span.lang === 'grc' && !span.firstChild.classList.contains('new');
			});
		makeShowHideButton($hasEntry, $('#toc'));
		break;
	}
	case 'Special:Watchlist':
	case 'Special:RecentChanges':
	case 'Special:RecentChangesLinked':
	case 'Special:Contributions':
	case 'Special:WhatLinksHere':
		importScript('User:Erutuon/scripts/watchlistScriptTagging.js'); //Linkback: ] Added by Script installer
		break;
	case 'Module:accel': case 'Module:accel/documentation':
	case 'Module:number_list': case 'Module:number_list/documentation':
		importScript('User:Erutuon/scripts/moduleDocumentation.js'); // Linkback: ]
		break;
	case 'User:Erutuon/mainspace_headers': {
		importScript('User:Erutuon/scripts/mainspaceHeaders.js'); // ]
		break;
	}
	case 'Wiktionary:AutoWikiBrowser/Script':
		if (mw.config.get('wgAction') === 'view')
			loadWikipediaScript('User:Joeytje50/JWB.js/load.js');
		break;
	default:
		if (contentModel === 'javascript')
			importScript('User:Erutuon/scripts/ScriptInstaller.js');	// ]
}

window.syntaxHighlighterConfig = {
	externalLinkColor: '#FFCC66', //orange
	wikilinkColor:     '#E6FFFF', //cyan
};

if (.includes(mwvalues.wgAction)) {
	var addApiResultToTextbox = function (funcName) {
		return function (str) {
			return withScript('User:Erutuon/scripts/apiWrapper.js', function () {
				if (!(funcName in apiWrapper))
					throw new Error("Function " + funcName + " not in apiWrapper");
	
				apiWrapper(str, function (result) {
					var $textbox = $('#wpTextbox1');
					try { // avoid error: currSelection is undefined
						$textbox.textSelection('replaceSelection', result);
					} catch (e) {
						$textbox.textSelection('setContents', result);
					}
				});
			});
		};
	};
	// Insert expanded wikitext into the text box, as if from
	// ].
	window.insertExpandedTemplate = addApiResultToTextbox('expandTemplates');
	
	// Replace selection in text box with the wikitext of a page.
	window.insertWikitext = addApiResultToTextbox('getWikitext');
	
	// Keep in sync with ].
	window.noHeadTempRegex = new RegExp("({3,7})*(?:" + [
		"Abbreviation",
		"Acronym",
		"Adjectival noun",
		"Adjective",
		"Adnominal",
		"Adverb",
		"Affix",
		"Article",
		"Circumfix",
		"Classifier",
		"Combining form",
		"Conjunction",
		"Contraction",
		"Counter",
		"Definitions",
		"Determiner",
		"Diacritical mark",
		"Gerund",
		"Han character",
		"Hanja",
		"Hanzi",
		"Idiom",
		"Infix",
		"Initialism",
		"Interfix",
		"Interjection",
		"Kanji",
		"Letter",
		"Ligature",
		"Logogram",
		"Noun",
		"Number",
		"Numeral",
		"Ordinal number",
		"Participle",
		"Particle",
		"Phrase",
		"Postposition",
		"Predicative",
		"Prefix",
		"Preposition",
		"Prepositional phrase",
		"Pronoun",
		"Proper noun",
		"Proverb",
		"Punctuation mark",
		"Relative",
		"Romanization",
		"Root",
		"Stem",
		"Suffix",
		"Syllable",
		"Symbol",
		"Verb",
		"Verbal noun"
	].join("|")
	+ ")*\\1*?#", "g");
	
	const makeTextboxRegexFinder = function (regex) {
		var textbox = $('#wpTextbox1');
		var searched = false;
		var failed = false;
		function doSearch() {
			var match = regex.exec(textbox.val());
			if (match) {
				textbox.textSelection('setSelection',
					{ start: match.index, end: match.index + match.length });
				textbox.focus();
			}
			return match;
		}
		return function () {
			if (failed) {
				return;
			}
			if (!searched) {
				noHeadTempRegex.lastIndex = 0;
			}
			var fromStart = regex.lastIndex === 0;
			var match = doSearch();
			if (!fromStart && regex.lastIndex === 0) {
				match = doSearch();
			}
			searched = Boolean(match);
			failed = fromStart && !match;
		};
	};
	
	if ( .includes(mw.config.get("wgAction"))
	&& (namespace === "" || namespace === "Reconstruction")
	&& mw.config.get("wgPageContentModel") === "wikitext"
	// Not in edit conflict view.
	&& !document.querySelector(".mw-twocolconflict-changes-col")
	&& noHeadTempRegex.test($('#wpTextbox1').val())) {
		$.getScript("//en.wiktionary.orghttps://en.wiktionary.org/w/index.php?title=User:Erutuon/scripts/CleanupButtons.js&action=raw&ctype=text/javascript")
			.done(function () {
			var buttons = new CleanupButtons();
			buttons.addButton({
				button: { text: "find missing headword-line template" },
				func: makeTextboxRegexFinder(noHeadTempRegex),
			});
		});
	}
}

// importScript('User:Dixtosa/rhyme.js');			// ]
// importScript('User:Dixtosa/expandASADRS.js');	// ]
// importScript('User:Dixtosa/skipToPost.js');		// ]
importScript('User:Erutuon/scripts/sidebar.js'); //Linkback: ] Added by Script installer
importScript('User:Erutuon/scripts/editableHeading.js'); //Linkback: ] Added by Script installer
// importScript('User:Dixtosa/SearchInTranslations.js'); //Linkback: ] Added by Script installer
importScript('User:Erutuon/scripts/editTop.js'); //Linkback: ] Added by Script installer

// ]
if (namespace === 'User')
	mw.loader.load('https://meta.wikimedia.orghttps://en.wiktionary.org/w/index.php?title=User:SMcCandlish/userinfo.js&action=raw&ctype=text/javascript');

if (namespace === 'Category') {
	var autoCatEditSummary = true;						// show edit summary
	importScript('User:Erutuon/scripts/addAutoCat.js');	// ]
	if ($(".language-category-info th").length > 0)
		importScript('User:Erutuon/scripts/showLanguageData.js');
}

// importScript('User:Dixtosa/highlightme.js'); //Linkback: ] Added by Script installer
// importScript('User:Dixtosa/WhoDidThat.js'); //Linkback: ] Added by Script installer

if (mwvalues.wgCategories
		&& mwvalues.wgCategories.includes('Wiktionary-namespace discussion pages'))
	importScript('User:Erutuon/scripts/discussionNavigation.js');	// ]

/* Scripts running based on contents of page */
if (document.querySelector('') !== null)
	importScript('User:Erutuon/scripts/modifyRussianTranslit.js'); //Linkback: ] Added by Script installer

if (namespace === '' && document.querySelector('.translations') !== null)
	importScript('User:Erutuon/scripts/simpleTranslations.js');		// ]

if (document.querySelector(''))
	importScript('User:Erutuon/scripts/changeCaseOrder.js'); //Linkback: ] Added by Script installer

{
	const grc = document.querySelectorAll("");
	const wrongApostrophe = //;
	var count = 0;
	for (var i = 0, len = grc.length; i < len; ++i) {
		const innerText = grc.innerText;
		if ( innerText && wrongApostrophe.test(innerText) ) {
			mw.notify("Wrong apostrophe detected in Ancient Greek text: " + innerText + ".");
			
			if (++count > 5)
				break;
		}
	}
}

// id="templatesandbox-editform" is always on edit pages, but only on
// template and module pages is it in a fieldset tag.
var templateSandboxEditform = document.getElementById("templatesandbox-editform");
if (templateSandboxEditform && templateSandboxEditform.tagName === "FIELDSET") {
	importScript("User:Erutuon/scripts/templatePreview.js");
}

if (namespace == 'Category') {
	$("div.CategoryTreeTag").find("a.CategoryTreeLabel").html(function(index, content) {
		return content.replace(
			/^Requests for (?:verification|deletion|cleanup) in (.+) entries$/,
			"$1"
		);
	});
	
	/*
	** On category pages, remove "0 c" or "0 e" from parentheses in listing of
	** subcategories.
	*/
	document.querySelectorAll('.CategoryTreeItem span').forEach(function (elem) {
		if (elem.title.startsWith('Contains')) {
			elem.innerHTML = elem.innerHTML
				.replace(/(?:, )?0 (?:, )?/, '');
		}
	});
}

$(":lang(uk-Latn)").html(function(index, content) {
	return content.replace(/v/g, "w");
});

var $example4ListItems = $("#example4 ul li");
if ($example4ListItems.length > 0) {
	var getListItemsToHide = function ($listItems, columnCount, rowsInShowState) {
		var count = $listItems.length;
		var itemsPerColumn = Math.ceil(count / columnCount);
		
		var $elemsToHide = $();
		if (itemsPerColumn > rowsInShowState) {
			for (var i = 0; i < columnCount; ++i) {
				var columnStart = i * itemsPerColumn;
				$elemsToHide = $elemsToHide
					.add($listItems.slice(columnStart + rowsInShowState, columnStart + itemsPerColumn));
			}
		}
		
		return $elemsToHide;
	};
	
	getListItemsToHide($example4ListItems, 3, 3)
		.addClass("vsHide").css('list-style-type',
		'"' + String.fromCodePoint(0x1F47B) + '"'); // JSHint doesn't like codepoint escapes ("\u{1F47B}").
}

window.getCodePointNames = function (str) {
	if (typeof str !== 'string')
		throw new Error("expected string, got " + typeof str);
	withScript('User:Erutuon/scripts/apiWrapper', function () {
		apiWrapper.expandTemplates(
			'{{#invoke:User:Erutuon/sandbox|get_code_point_names|' + str + '}}',
			function (wikitext) {
				var names = JSON.parse(wikitext);
				console.log(names);
			});
		});
};

Object.getPrototypeOf(localStorage).keys = function () {
	return Object.getOwnPropertyNames(this);
};

// ]
// loadWikipediaScript('User:Anomie/previewtemplatelastmod.js');

// ]
loadWikipediaScript('User:קיפודנחש/searchPersistence.js');

// ]
if (contentModel === 'javascript') {
	mw.loader.using('mediawiki.util', function () {
		$(function () {
			var link = document.createElement('a'); // used but not inserted into DOM
			var stringClasses = ;
			
			$('.mw-highlight').find('.nx').each(function (_, identifierElement) {
				var identifier = identifierElement.textContent;

				if (identifier === 'importScript' || identifier === 'importStylesheet') {
					var parenthesis = identifierElement.nextSibling;
					var string = parenthesis && parenthesis.nextSibling;
					if (!(parenthesis && parenthesis.className === 'p'
							&& parenthesis.textContent === '(' && string
							&& stringClasses.indexOf(string.className) !== -1))
						return;
					
					string.innerHTML = string.innerHTML.replace(/^()(.+\.(?:js|css))()$/,
						function (match, quote1, path, quote2) {
							link.href = mw.util.getUrl(path);
							link.textContent = path;

							return quote1 + link.outerHTML + quote2;
						});
				}
			});

		});
	});
}

if (contentModel === 'Scribunto' && mw.config.get('wgCurRevisionId') === 0
&& /\/sandbox$/.test(pageName)) {
	$(function () {
		var sandboxOf = pageName.replace(/\/sandbox$/, '');
		insertWikitext(sandboxOf);
		$('#wpSummary').val('copy of ]');
	});
}

window.unPercentify = function () {
	location.pathname = decodeURIComponent(location.pathname);
};

window.getNameOf = function(obj) {
	return Object.getPrototypeOf(obj).constructor.name;
};

// Adds a button after the 'refresh' link in module testcases produced by
// ] to hide all successful testcases (making it easier to
// find the failing ones).
if (namespace === 'Module') {
	const $unitTests = $('table.unit-tests');
	if ($unitTests.length > 2) {
		const $hideSuccessesButton = $('<span>')
			.addClass('unit-tests-hide-successes')
			.css('cursor', 'pointer')
			.click(function() {
				this.successesShown = !this.successesShown;
				this.showHideFunc();
			})
			.html('(hide successes)');
		hideSuccessesButton = $hideSuccessesButton;
		hideSuccessesButton.successesShown = true;
		hideSuccessesButton.showHideFunc = function () {
			$unitTests.toggleClass('unit-tests-hide-passing', !this.successesShown);
			this.textContent = this.successesShown ? '(hide successes)' : '(show successes)';
		};
		hideSuccessesButton.showHideFunc();
		
		$('.unit-tests-refresh')
			.closest('p')
			.append(' ')
			.append($hideSuccessesButton);
	}
}

window.getSearchTitles = function getSearchTitles() {
	return $('.mw-search-result-heading a').get()
		.map(function (elem) {
			return elem.textContent;
		});
};

if (mw.config.get('wgNamespaceNumber') === 0 && mw.config.get('wgRevisionId') === 0)
	importScript('User:Erutuon/scripts/graveToAcuteRedirect.js');
})(); // IIFE

// Reduce names of request categories to language name.
$(function () {
	const match = mw.config.get('wgPageName').match(/Category:Requests_for_(.+?)_by_language/);
	if (match) {
		const regex = new RegExp("Requests for " + match.replace(/_/g, " ") + " in (.+?) entries", "g");
		$('.CategoryTreeItem a')
			.get()
			.forEach(function(e) {
				e.textContent = e.textContent.replace(regex, '$1');
			});
	}
});

if (.includes(mw.config.get("wgAction"))) {
	importScript('User:Erutuon/scripts/cleanup.js'); //Linkback: ] Added by Script installer
}

importScript( 'User:So9q/CreateTranslation.js' ); // Backlink: ]

if (document.querySelector('')) {
	importScript('User:Erutuon/scripts/Marshallese.js'); // ]
}

window.catfixReconstructedAsterisk = true;

(function findParserReport() {
	const contentElement = document.getElementById("content");
	if (contentElement) {
		const iter = document.createNodeIterator(contentElement, NodeFilter.SHOW_COMMENT, function() { return NodeFilter.FILTER_ACCEPT; });
		var node;
		while ((node = iter.nextNode())) {
			const value = node.nodeValue;
			if (value.includes("NewPP limit report")) {
				console.info(value.trim()); break;
			}
		}	
	}
})();

// Various fixes for the trees generated by ].
// This code works with old classes (beginning with familytree) and new classes
// (beginning with ft).
$(function () {
	// Show the top toggle.
	$('.ft-toptoggle, .familytree-toptoggle').css('display', '');
	
	var customtogglePrefix = 'ft';
	
	// Initialize the text of the toggles.
	$('.ftree, .familytree').get().forEach(function (tree) {
		var isCollapsed = tree.classList.contains('mw-collapsed');
		var toggles = $(tree).find('.ft-toggle, .familytree-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();
        }
    });
});

$(function() {
	Array.from(document.querySelectorAll('.mw-widget-searchInputWidget .oo-ui-inputWidget-input')).forEach(function(e) { console.log(e.value + "\nhttps://en.wiktionary.org?search=" + encodeURIComponent(e.value)); });
	
    const url = new URL("https:" + mw.config.get("wgServer") + mw.config.get("wgScript"));
    const params = url.searchParams;
    const pageName = mw.config.get("wgPageName");
    params.set("title", "Special:ExpandTemplates");
    if (pageName === "Special:ExpandTemplates") {
    	.forEach(function(name) {
    		params.set(name, document.getElementsByName(name).value);
    	});
    } else {
	    params.set("wpContextTitle", pageName);
	    params.set(
	    	"wpInput",
	    	"{{" + (mw.config.get("wgNamespaceNumber") === 0 ? ":" : "") + pageName + "}}"
	    );
    }
    console.log("Open wikitext in Special:ExpandTemplates:\n" + url.toString());
});

window.GPE = window.GPE || {};
window.GPE.initialDeleteReason = ']';

mw.loader.using().done(function() {
    mw.hook('enwiktionary.edittools.addCategory').fire([
        {name: 'Polabian', insertBefore: null, html: '<span class="charinsert">A a Ă ă Å å Ą ą B b B́ b́ C c Ć ć Č č D d Ď ď Ʒ ʒ Ʒ́ ʒ́ E e Ė ė Ĕ ĕ F f G g Ǵ ǵ H h Χ χ Χ́ χ́ I i J j K k Ḱ ḱ L l Ľ ľ M m Ḿ ḿ N n Ń ń O o Ö ö Ǫ ǫ P p Ṕ ṕ R r Ŕ ŕ S s Ś ś Š š T t Ť ť U u Ü ü V v V́ v́ Z z Ź ź Ž ž ai̯ au̯ åi̯ åu̯ oi̯ üi̯</span>'},
        { name: 'Slovincian', insertBefore: 'Polabian', html: '...' }
    ]);
});

window.noDefaultVisibilityToggles = true;

mw.loader.using(, function() {
	importScript('User:Erutuon/scripts/defaultVisibilityToggles.js');
});

function makeLocalScriptUrl(title) {
	const url = new URL("https:" + mw.config.get("wgServer") + mw.config.get("wgScriptPath"));
	url.search = new URLSearchParams({
		"title": title,
		"action": "raw",
		"ctype": "text/javascript",
	});
	return url;
}

mw.loader.using([
	"ext.gadget.Editor", "ext.gadget.LegacyScriptsNewNode", "mediawiki.cookie",
	"ext.gadget.LanguageUtils", "mediawiki.util"
])
.then(function() {
	importScript("User:Erutuon/scripts/TranslationAdder-Data.js");
	importScript('User:Erutuon/scripts/TranslationAdder.js');
})
.fail(console.error);

importScript("User:Erutuon/scripts/todo-lists.js");
importScript('w:User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: ]

// </nowiki>

window.accelEverywhere = true;

window.noDefinitionLineFragmentAddition = true;