မီႇတီႇယႃႇဝီႇၶီႇ:Gadget-Special characters.js

လုၵ်ႉတီႈ ဝီႇၶီႇပပ်ႉ မႃး
မၢႆတွင်း: ဝၢႆးသေသိမ်းပၼ်ယဝ်ႉ၊ တွၼ်ႈတႃႇ ၸဝ်ႈၵဝ်ႇ တေႁၼ်လႆႈ လွင်ႈလႅၵ်ႈလၢႆႈၼၼ်ႉ ၸဝ်ႈၵဝ်ႇတေၸၢင်ႈလႆႈလတ်းၶၢမ်ႈ ၶႅတ်ႉၶျ် တူဝ်ပိုတ်ႇဝႅပ်ႉၸဝ်ႈၵဝ်ႇယဝ်ႉ။
  • ၽွင်းမိူဝ်ႈတိုၵ်ႉၼဵၵ်း Reload တီႈ Firefox / Safari: ၼၼ်ႉ ၼဵၵ်းဝႆႉပႃး Shift ၊ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5 ဢမ်ႇၼၼ် Ctrl-R (တီႈၼႂ်း Mac ၼႆ ၼဵၵ်းပၼ်⌘-R)
  • တီႈၼႂ်း Google Chrome: ၼဵၵ်းပၼ် Ctrl-Shift-R (တီႈၼႂ်း Mac ၼႆႉ ၼဵၵ်းပၼ်⌘-Shift-R )
  • ၽွင်းမိူဝ်ႈ တိုၵ်ႉၼဵၵ်း Refreshတီႈ Internet Explorer/ Edge: ၼဵၵ်းဝႆႉပၼ် Ctrl ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5
  • တီႈၼႂ်း Opera: ၵႂႃႇၸူးတီႈ Menu → Settings (ပေႃးပဵၼ်တီႈၼႂ်း Mac ၸိုင် Opera → Preferences ) သေ သိုပ်ႇၵႂႃႇ Privacy & security → Clear browsing data → Cached images and files ၼၼ်ႉလႄႈ။
/* Change [[MediaWiki:Edittools]] into true buttons. */

$(document).ready( function($) {
	var	$sc = $('#specialchars'),
		$sb = $sc.find('.specialbasic'),
		$sel,
		$placeholder,
		bl = $sb.length,
		ci = 0;
	
	$placeholder = $('<span id="#specialchars-before"></span>');
	$sc = $sc.before($placeholder).detach();
	
	if ( bl > 1 ) {
		ci = Number( $.cookie('mw-charinsert') ) || 0;
		if ( ci > bl ) {
			$.cookie( 'mw-charinsert', 0, { expires: 30, path: '/' } );
			ci = 0;
		}
		$sel = $( '<select>' ).change( function(e) {
			var	$this = $( this ),
				i = Number( $this.val() ),
				last = Number( $.cookie('mw-charinsert') ) || 0;
 
			if ( last !== i ) {
				$sb.eq( last ).css( 'display', 'none' );
				$sb.eq( i ).css( 'display', 'inline' );
				$.cookie( 'mw-charinsert', i, { expires: 30, path: '/' } );
			}
		});
	}
	
	$.eachAsync($sb, {
		'delay': 1,
		'bulk': 0,
		'loop': function(i,v) {
			var id = $(this)
				.css('display', i !== ci ? 'none' : 'inline')
				.find('a').replaceWith( function() {
					var $this = $(this), onclick = $this.attr( 'onclick' );
					return $( '<button>', { type: 'button', text: $this.text() } )
						.blur()
						.click( $.isFunction( onclick ) ? onclick : Function( onclick ) );
				})
				.end()
				.attr( 'id' )
				.replace( /\.([0-9A-F]{2})/g, '%$1' )
				.replace( /_/g, ' ' );
			
				if ( bl > 1 ) {
					$sel.append(
						'<option value="' + i + '"' + (i === ci ? ' selected="selected"' : '') + '>'
						+ decodeURIComponent( id )
						+ '</option>'
				);
			}
		},
		'end': function() {
			$sc.prepend($sel);
			$sel.change();
			$placeholder.after($sc).remove();
		}
	});
});