לדלג לתוכן

מדיה ויקי:Gadget-toggleRCOptions.js: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
מ דף חדש: // // // Created by user:Yonidebest function findText() { var findThisRx = new RegExp(document.getElementById('fromReplace').value, 'g'); var foundIndex = document.editform.wpTex...
 
מ 69 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-toggleRCOptions.js יובאו
 
(68 גרסאות ביניים של 4 משתמשים אינן מוצגות)
שורה 1: שורה 1:
//
var $match = $('.rcoptions, #mw-watchlist-form, #Recentchangestext');
//
// Important: many pages do not load this module by default so make sure it's loaded.
// Created by [[user:Yonidebest]]
if ($match.length) {
 
mw.loader.using('jquery.makeCollapsible').then( function () {
function findText() {
// Hides the RC options by default (incl. toggle button)
var findThisRx = new RegExp(document.getElementById('fromReplace').value, 'g');
$match.makeCollapsible({collapsed:true});
var foundIndex = document.editform.wpTextbox1.value.search(findThisRx);
} );
var statusFind = document.getElementById('statusFind');
if (foundIndex != -1) {
  document.editform.wpTextbox1.value = tempText;
  statusFind.innerHTML = 'בוצע!';
} else statusFind.innerHTML = 'לא נמצאו מופעים.';
}
}
function toggleFindText() {
var divBoxFind = document.getElementById('divFind');
var aFind = document.getElementById('aFind');
if (divBoxFind.style.display == 'none') {
  divBoxFind.style.display = 'block';
  aFind.innerHTML = '[הסתר]';
} else {
  divBoxFind.style.display = 'none';
  aFind.innerHTML = 'בצע החלפה';
}
}
function addFindText() {
var toolbar = document.getElementById('toolbar');
if (!toolbar) return;
var iFind = document.createElement('<INPUT ID="findInput"></INPUT>');
iFind.type = 'text';
iFind.onchange = function() {javascript:document.getElementById("statusReplace").innerHTML = "מחכה.";};
var submitFind = document.createElement('A');
submitFind.href = 'javascript:findText();';
submitFind.appendChild(document.createTextNode('חפש'));
var statusFind = document.createElement('<SPAN ID="statusFind"></SPAN>');
statusFind.appendChild(document.createTextNode('מחכה.'));
var divBoxFind = document.createElement('<DIV ID="divFind"></DIV>');
divBoxFind.appendChild(document.createTextNode('חפש את '));
divBoxFind.appendChild(iFind);
divBoxFind.appendChild(document.createTextNode(' '));
divBoxFind.appendChild(submitFind);
divBoxFind.appendChild(document.createTextNode(' | סטטוס: '));
divBoxFind.appendChild(statusFind);
divBoxFind.appendChild(document.createElement('BR'));
var aFind = document.createElement('<A ID="aFind"></A>');
aFind.href = 'javascript:toggleFindText();';
aFind.appendChild(document.createTextNode('חפש'));
toolbar.appendChild(aFind);
toolbar.appendChild(document.createTextNode(' '));
toolbar.appendChild(divBoxFind);
toggleFindText();
}
addOnloadHook(addReplaceText);

גרסה אחרונה מ־13:04, 5 בדצמבר 2022

var $match = $('.rcoptions, #mw-watchlist-form, #Recentchangestext');
// Important: many pages do not load this module by default so make sure it's loaded.
if ($match.length) {
	mw.loader.using('jquery.makeCollapsible').then( function () {
		// Hides the RC options by default (incl. toggle button)
		$match.makeCollapsible({collapsed:true});
	} );
}