"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
(താളിലെ വിവരങ്ങൾ /*ടൂൾബാറിൽ അവലംബം ചേർക്കാനുള്ള സ... എന്നാക്കിയിരിക്കുന്നു) |
No edit summary |
||
| വരി 4: | വരി 4: | ||
importScript( 'മീഡിയവിക്കി:Common.js/edit.js' ); | importScript( 'മീഡിയവിക്കി:Common.js/edit.js' ); | ||
} | } | ||
/* | |||
==addCharSubsetMenu== | |||
*/ | |||
/* add menu for selecting subsets of secial characters */ | |||
/***** must match MediaWiki:Edittools *****/ | |||
function addCharSubsetMenu() { | |||
if($('#editpage-specialchars').length>0) { | |||
/* default subset from cookie */ | |||
var s = parseInt( $.cookie('edittoolscharsubset') ); | |||
if ( isNaN(s) ) s = 0; | |||
var $menu = $('<select />') | |||
.attr('id', 'charSubsetControl') | |||
.css('display', 'inline'); | |||
$menu.change(chooseCharSubset) | |||
.data('previousSelectedIndex', s) | |||
.append($('<option />').text('ഫലകങ്ങൾ')) | |||
.append($('<option />').text('വിക്കിവിന്യാസങ്ങൾ')) | |||
.append($('<option />').text('അനുമതിപത്രങ്ങൾ')) | |||
.append($('<option />').text('മലയാളം')) | |||
.append($('<option />').text('കൊറിയൻ')) | |||
.append($('<option />').text('ലത്തീൻ')) | |||
.append($('<option />').text('ഐ.പി.എ.')) | |||
.append($('<option />').text('പലവക')) | |||
.append($('<option />').text('അറബി')) | |||
.append($('<option />').text('ദേവനാഗരി')) | |||
.append($('<option />').text('ഹിബ്രു')) | |||
.append($('<option />').text('പഴയ ഇംഗ്ലീഷ്')); | |||
$('#editpage-specialchars').prepend($menu); | |||
/* update dropdown control to value of cookie */ | |||
$('#charSubsetControl')[0].selectedIndex = s; | |||
$('p', '#editpage-specialchars').each(function(index) { | |||
if(index==s) { | |||
$(this).css('display', 'inline'); | |||
$(this).css('visibility', 'visible'); | |||
} else { | |||
$(this).css('display', 'none'); | |||
$(this).css('visibility', 'hidden'); | |||
} | |||
}); | |||
} | |||
} | |||
/* | |||
===chooseCharSubsetMenu=== | |||
*/ | |||
/* select subsection of special characters */ | |||
function chooseCharSubset() { | |||
var selectedIndex = $(this).find(':selected').index(); | |||
$('p', '#editpage-specialchars').each(function(index) { | |||
if(index==selectedIndex) { | |||
$(this).css('display', 'inline'); | |||
$(this).css('visibility', 'visible'); | |||
}else { | |||
$(this).css('display', 'none'); | |||
$(this).css('visibility', 'hidden'); | |||
} | |||
}); | |||
$.cookie('edittoolscharsubset', selectedIndex); | |||
$(this).data('previousSelectedIndex', selectedIndex); | |||
} | |||
/* | |||
== customizeWikipedia == | |||
*/ | |||
function customizeWikipedia() { | |||
addCharSubsetMenu(); | |||
} | |||
$(customizeWikipedia); | |||
22:04, 1 ഡിസംബർ 2019-നു നിലവിലുണ്ടായിരുന്ന രൂപം
/*ടൂൾബാറിൽ അവലംബം ചേർക്കാനുള്ള സൗകര്യം കൂട്ടിച്ചേർക്കുന്നതിനായി */
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
/* scripts specific to editing pages */
importScript( 'മീഡിയവിക്കി:Common.js/edit.js' );
}
/*
==addCharSubsetMenu==
*/
/* add menu for selecting subsets of secial characters */
/***** must match MediaWiki:Edittools *****/
function addCharSubsetMenu() {
if($('#editpage-specialchars').length>0) {
/* default subset from cookie */
var s = parseInt( $.cookie('edittoolscharsubset') );
if ( isNaN(s) ) s = 0;
var $menu = $('<select />')
.attr('id', 'charSubsetControl')
.css('display', 'inline');
$menu.change(chooseCharSubset)
.data('previousSelectedIndex', s)
.append($('<option />').text('ഫലകങ്ങൾ'))
.append($('<option />').text('വിക്കിവിന്യാസങ്ങൾ'))
.append($('<option />').text('അനുമതിപത്രങ്ങൾ'))
.append($('<option />').text('മലയാളം'))
.append($('<option />').text('കൊറിയൻ'))
.append($('<option />').text('ലത്തീൻ'))
.append($('<option />').text('ഐ.പി.എ.'))
.append($('<option />').text('പലവക'))
.append($('<option />').text('അറബി'))
.append($('<option />').text('ദേവനാഗരി'))
.append($('<option />').text('ഹിബ്രു'))
.append($('<option />').text('പഴയ ഇംഗ്ലീഷ്'));
$('#editpage-specialchars').prepend($menu);
/* update dropdown control to value of cookie */
$('#charSubsetControl')[0].selectedIndex = s;
$('p', '#editpage-specialchars').each(function(index) {
if(index==s) {
$(this).css('display', 'inline');
$(this).css('visibility', 'visible');
} else {
$(this).css('display', 'none');
$(this).css('visibility', 'hidden');
}
});
}
}
/*
===chooseCharSubsetMenu===
*/
/* select subsection of special characters */
function chooseCharSubset() {
var selectedIndex = $(this).find(':selected').index();
$('p', '#editpage-specialchars').each(function(index) {
if(index==selectedIndex) {
$(this).css('display', 'inline');
$(this).css('visibility', 'visible');
}else {
$(this).css('display', 'none');
$(this).css('visibility', 'hidden');
}
});
$.cookie('edittoolscharsubset', selectedIndex);
$(this).data('previousSelectedIndex', selectedIndex);
}
/*
== customizeWikipedia ==
*/
function customizeWikipedia() {
addCharSubsetMenu();
}
$(customizeWikipedia);