$(function() { 	var installed = false; 	function installSummary( $summaryBox, smallArea ) { 		if (installed) { 			return; 		} 		installed = true; 		 		function addSummary() { 		    var summary = $(this).data('summary'); 			var text = summary.title; 			var sum = $summaryBox, curr = sum.val(); 			var comma = curr.length > 0 && curr.charAt(curr.length - 2) != "/"; 			sum.val(curr + (comma ? ', ' : ) + text).trigger('input'); 		}  		var summaries = window.summaries || []; 		summaries = summaries.concat([ 			"সাধারণ", 			{"title": "যোগ","content": "যোগ"}, 			{"title": "সংশোধন","content": "সংশোধন"}, 			{"title": "সম্প্রসারণ","content": "সম্প্রসারণ"}, 			{"title": "তথ্যসূত্র","content": "তথ্যসূত্র"}, 			{"title": "পরিষ্কারকরণ","content": "পরিষ্কারকরণ"}, 			{"title": "অনুবাদ","content": "অনুবাদ"}, 			{"title": "রচনাশৈলী","content": "রচনাশৈলী"}, 			{"title": "বিষয়শ্রেণী","content": "বিষয়শ্রেণী"}, 			{"title": "চিত্র","content": "চিত্র"}, 			{"title": "বিষয়বস্তু যোগ","content": "বিষয়বস্তু যোগ"}, 			{"title": "বানান সংশোধন","content": "বানান সংশোধন"}, 			{"title": "হালনাগাদ","content": "হালনাগাদ"},                         {"title": "পাতা তৈরি","content": "পাতা তৈরি"}, 			{"title": "টেমপ্লেট","content": "টেমপ্লেট"}, 			{"title": "ট্যাগ","content": "ট্যাগ"} 		]); 		if (mw.config.get('wgNamespaceNumber') % 2 === 1 || mw.config.get('wgNamespaceNumber') === 4) { 			summaries = summaries.concat([ 			"আলাপ", 			{"title": "উত্তর","content": "উত্তর প্রদান"}, 			{"title": "মন্তব্য","content": "মন্তব্য যোগ"} 			]); 		} 		var minorSummaries = ["সংশোধন", "সম্প্রসারণ", "তথ্যসূত্র", "পরিষ্কারকরণ", "বিষয়শ্রেণী", "ট্যাগ", "বানান", "হালনাগাদ"]; 		var div = $("<div>", {id: "summariesList"}) 			.css({width: ( smallArea? "100%" : "65%" ), padding: "2px"});  		for (var i = 0; i < summaries.length; i++) { 			var summary = summaries[i]; 			var summaryButton = $('<span>').css({marginLeft: '0.4em', whiteSpace: 'nowrap'}).data({summary: summary}); 			var label;  			if (typeof summary === "string") { 				div.append(smallArea? '' : ' '); //allow text wrap here 				summaryButton.text(summary + ':'); 			} else { 				label = summary.label || summary.title; 				summaryButton.html('&nbsp' + label + '&nbsp') 					.addClass('clickable-edit-summary') 					.attr('title', summary.content || ) 					.css({'background-color': '#cceeff', color: '#666666', border: 'solid 1px #aaddff', cursor: 'pointer'}) 					.click(addSummary); 				if (smallArea) { 					div.append(' '); 				} 			} 			div.append(summaryButton); 		}  		return div; 	}  if (($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) + 1) && ($('[name="wpSection"]').val()!='new')) { 	 mw.loader.using( 'user' ).always( function() {  // make sure personal script page is loaded, fo users who deine "summaries =" in their personal page. see talkpage. 		$('#wpSummaryWidget').after(installSummary( $('input[name=wpSummary]'), false, function(val) { $('[name=wpMinoredit]').prop('checked', val); } )); 	 }); }  mw.hook( 've.saveDialog.stateChanged' ).add(function(){     var target = ve.init.target;     var $summaryBox = target.saveDialog.$body.find('.ve-ui-mwSaveDialog-summary textarea');     $('.ve-ui-mwSaveDialog-summary').after(installSummary( $summaryBox, true, function(val) { ve.init.target.saveDialog.checkboxesByName.wpMinoredit.setSelected(val); } ));  });  });