မီဒီယာဝီခီ:Gadget-switcher.js
တောင်ꩻသေꩻ။ ဒင်ႏထင်ႏထွူသွူခါ ဖေႏကထီႏနွောင်ꩻ ပြောင်ꩻလုဲင်ႏမုꩻဖုံႏတာႏ နာꩻအနေႏ အဝ်ႏလိုႏကာႏနွောင်ꩻ ဗရောင်သာ cache နဝ်ꩻသွူ။
- အဝ်ႏနျꩻ Firefox / Safari: Reload ယိုကျာꩻ တေက်ꩻခါꩻပါသွော့ Shift သြ၊ မွေးတဝ်းလဲ့ နျꩻသွော့ Ctrl-F5 တဝ်းလဲ့ Ctrl-R (Mac နဝ်ꩻ ⌘-R) ယိုသြ။
- Google Chrome: Ctrl-Shift-R (Mac နဝ်ꩻ ⌘-Shift-R) ယိုသြ။
- Internet Explorer / Edge: Refresh ယိုကျာꩻ တေက်ꩻခါꩻပါသွော့ Ctrl သြ၊ မွေးတဝ်းလဲ့ နျꩻသွော့ Ctrl-F5 ယိုသြ။
- Opera: Menu → Settings (Mac နဝ်ꩻ Opera → Preferences) ကိုတဲင် မာꩻပါသွော့ Privacy & security → Clear browsing data → Cached images and files ယိုသြ။
'use strict';
$( function () {
$.each( document.querySelectorAll( '.switcher-container' ), function ( i ) {
var activeElement,
switchers = [], container = this, radioName = 'switcher-' + i;
$.each( this.children, function () {
var $radio, switcher = this,
$labelContainer = $( switcher.querySelector('.switcher-label') ),
$labelText = $labelContainer.contents();
if ( !$labelText.length ) {
return;
}
switchers.push( switcher );
$radio = $( '<input type="radio">' ).attr( 'name', radioName ).click( function () {
$( activeElement ).hide();
$( switcher ).show();
activeElement = switcher;
} );
if ( !activeElement ) {
// Mark the first one as selected
activeElement = switcher;
$radio.prop( 'checked', true );
} else if ( $labelContainer.attr( 'data-switcher-default' ) !== undefined ) {
// Custom default
$radio.click();
} else {
// Hide non-default
$( switcher ).hide();
}
$( '<label style="display:block"></label>' ).append( $radio, $labelText ).appendTo( container );
$labelContainer.remove();
} );
if ( switchers.length > 1 ) {
$( '<label style="display:block">အွဉ်ႏနယ်လို့</label>' ).prepend(
$( '<input type="radio">' ).attr( 'name', radioName ).click( function () {
$( switchers ).show();
activeElement = switchers;
} )
).appendTo( container );
}
if ( switchers.length === 1 ) {
$radio.remove();
}
} );
} );