মিডিয়াৱিকি:Common.js

ৱিকিউৎসৰ পৰা

টোকা: প্ৰকাশ কৰাৰ পাছত পৰিৱৰ্তনসমূহ চাবৰ বাবে আপোনাৰ ব্ৰাউজাৰত কেশ্ব অগ্ৰাহ্য কৰিবলগীয়া হ'ব পাৰে।

  • ফায়াৰফক্স / চাফাৰি: Shift ধৰি ৰাখি Reload ক্লিক কৰক, বা Ctrl-F5 আৰু Ctrl-R ৰ ভিতৰত যিকোনো এটা ক্লিক কৰক (মেকত ⌘-R)
  • গুগল ক্ৰ'ম: Ctrl-Shift-R টিপক (মেকত ⌘-Shift-R)
  • ইণ্টাৰনে'ট এক্সপ্ল'ৰাৰ / এড্‌জ: Ctrl ধৰি ৰাখি Refresh ক্লিক কৰক, বা Ctrl-F5 টিপক
  • অপেৰা: Ctrl-F5 টিপক।
//<syntaxhighlight lang="javascript">
/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since Common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
/* global mw, $, importStylesheet, importScript */
/* jshint curly:false, strict:false, eqnull:true, browser:true */

mw.loader.using( ['mediawiki.user', 'mediawiki.util', 'jquery.client'] ).done( function () {
/* Begin of mw.loader.using callback */

/**
 * Scripts imported from wikisource.org
 * see [[oldwikisource:Wikisource:Shared Scripts]] for details
 */
//	mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript');
mw.loader.load('//as.wikisource.org/w/index.php?title=MediaWiki:PageNumbers.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:IndexForm.js&action=raw&ctype=text/javascript');
//	mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:OCR.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:DisplayFooter.js&action=raw&ctype=text/javascript');
// Dictionary.js used for [[DL]]-type links, as per [[A Dictionary of Music and Musicians/A]]
//	mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:Dictionary.js&action=raw&ctype=text/javascript');
//	mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:Corrections.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:InterWikiTransclusion.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:দিব্য দত্ত/Script/Pratisthapon.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Indic-TechCom/Script/OCR4VE.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Indic-TechCom/Script/shortUrlLink.js&action=raw&ctype=text/javascript');
/**
 * Script for Google OCR by Cloud Vision API
 */
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:GoogleOCR.js&action=raw&ctype=text/javascript');

// Search results from Wikidata
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
        mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}

/**
 * Messages are configurable here
 */
if(!self.ws_messages) self.ws_messages = { };

window.ws_msg = function (name) {
	var m = self.ws_messages[name];
	if(m) return m; else return name;
};

self.ws_messages = {
	'author':'লেখক',
	'translator':'অনুবাদক',
	'editor':'সম্পাদক',
	'publisher':'প্ৰকাশক',
	'place':'স্থান',
	'volume':'খণ্ড',
	'school':'বিদ্যালয়',
	'book':'গ্ৰন্থ',
	'collection':'সংগ্ৰহ',
	'journal':'জাৰ্ণাল বা আলোচনী',
	'phdthesis':'থিছিছ, প্ৰতিবেদন',
	'dictionary':'অভিধান',
	'progress':'অগ্ৰগতি',
	'progress_T':'সম্পন্ন',
	'progress_V':'বৈধকৰণ বাকী',
	'progress_C':'মুদ্ৰণ সংশোধন বাকী',
	'progress_MS':'মিল আৰু বিভক্তৰ বাবে সাজু',
	'progress_OCR':'উৎস ফাইলত OCR পাঠ্য স্তৰৰ প্ৰয়োজন',
	'progress_L':'উৎস ফাইল ভুল (পৃষ্ঠা নাই, ক্ৰম ভুল ইত্যাদি)',
	'progress_X':'পৃষ্ঠাৰ তালিকাৰ প্ৰয়োজন (মুদ্ৰণ সংশোধনৰ পূৰ্বে ফাইলটো সম্পূৰ্ণ আৰু সঠিক হয়নে নহয় নিশ্চিত কৰিবলৈ)',
	'▲':'পৃষ্ঠাৰ ওপৰলৈ যাওক।',

	'corr_list':'List of typos identified on this page',
	'corr_link':'Typos Marked',
	'corr_one':'One typo</a> has been marked.',
	'corr_many':' typos</a> have been marked.',
	'corr_close':'বন্ধ কৰক।',

	'iwtrans':'Its text comes from',
	'iwtrans2':'Its text comes from other Wikisource subdomains.',

	'page_namespace_name':      'পৃষ্ঠা',
	'page_trascluded_in':       'পৃষ্ঠা অন্তৰ্ভুক্ত হৈছে:',
	'text_number':              'পাঠ',

	'compare_with':  'Comparison with:',
	'compare_texts': 'Compare texts'
};

/* stop faux red links on fresh links */
$( 'div.mw-body a' ).removeClass( 'stub' );

/**
 * Envelope subNotes found in main navigation header derivatives
 * Namespace coverage: Main (ns-0), Translation (ns-114)
 * See also _____
 * 
 * Ver 0.10, 2015-01-31
 */
jQuery( document ).ready( function ( $ ) {
	var nsSubNotes = [ 0, 114 ];
	if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), nsSubNotes ) !== -1 ) {
		$( 'div.subNote' ).insertBefore( $( 'div#ws-data' ) ); 
	}
} );
/**
 * Envelope hatNotes & similar into main navigation header container
 * Namespace coverage: Main (ns-0), Translation (ns-114)
 * See also _____
 * 
 * Ver 0.30, 2015-12-31
 */
jQuery( document ).ready( function ( $ ) {
	var nsHatNotes = [ 0, 114 ];
	if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), nsHatNotes ) !== -1 ) {
		$( 'div.similar' ).prependTo( $( 'div#headerContainer' ) ); 
		$( 'table.ambox' ).prependTo( $( 'div#headerContainer' ) );
	}
} );
/**
 * Force Footer &/or end matter out of Dynamic Layouts
 * Namespace coverage: Main (ns-0), Translation (ns-114)
 * See also _____
 * 
 * Ver 0.40, 2015-01-31
 */
jQuery( document ).ready( function ( $ ) {
	var nsFooters = [ 0, 114 ];
	if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), nsFooters ) !== -1 ) {
		$( 'table.acContainer' ).insertAfter( $( 'div.printfooter' ) );
		$( 'div.licenseContainer' ).not( 'div.licenseContainer div.licenseContainer' ).insertBefore( $( 'div#catlinks' ) );
	}
} );
/**
 * Force Header &/or section heading matter out of Dynamic Layouts
 * Namespace coverage: Main (ns-0), Translation (ns-114)
 * See also _____
 * 
 * Ver 0.20, 2015-12-31
 */
jQuery( document ).ready( function ( $ ) {
	var nsHeaders = [ 0, 114 ];
	if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), nsHeaders ) !== -1 ) {
		$( 'div#headerContainer' ).prependTo( $( 'div#mw-content-text' ) );
		$( 'div#heederContainer' ).prependTo( $( 'div#mw-content-text' ) );
		$( 'div#heedertemplate' ).prependTo( $( 'div#mw-content-text' ) );
	}
} );
/**
 * PageNumbers   Dynamic Layouts helper
 *
 * removes sidebar Display Options menu from all ns except Main and Translation
 *
 */
jQuery( document ).ready( function ( $ ) {
	var nsDynamicLayouts = [ -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 100, 101, 102, 103, 104, 105, 106, 107, 115, 828, 829 ];
	if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), nsDynamicLayouts ) !== -1 ) {
		$( 'div' ).remove( '#p-do' );
	}
} );
/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */
//</syntaxhighlight>