מדיה ויקי:סקריפטים/81.js – הבדלי גרסאות
תוכן שנמחק תוכן שנוסף
ניסוי |
אפשרות לכבות |
||
שורה 23: | שורה 23: | ||
Object.keys( things ) |
Object.keys( things ) |
||
.forEach( function(key) { |
.forEach( function(key) { |
||
$( mw.util.addPortletLink( 'p-cactions', '', key ) ).click( gothere ); |
if (things[key]) |
||
$( mw.util.addPortletLink( 'p-cactions', '', key ) ).click( gothere ); |
|||
} ); |
} ); |
||
} ); |
} ); |
גרסה אחרונה מ־20:34, 22 באוגוסט 2022
// display system-messages names instead of the system messages themselves.
mw.loader.using( 'mediawiki.util' ).done( function() {
var things = { 'הצג הודעות מערכת' : 'uselang=qqx',
'חזותי': 'veaction=edit',
'purge': 'action=purge',
'safemode': 'safemode=1',
'debug': 'debug=1'
};
if (window.index_php_params) {
$.extend(things, window.index_php_params);
}
function gothere( e ) {
var key = $( this ).text(),
there = things[key];
e.preventDefault();
var href = window.location.href.replace( /#.*/, '' );
href += ( ( /\?/.test( href ) ? '&' : '?' ) + there );
window.location.href = href;
}
Object.keys( things )
.forEach( function(key) {
if (things[key])
$( mw.util.addPortletLink( 'p-cactions', '', key ) ).click( gothere );
} );
} );