ট্যাগ: পুনর্বহালকৃত মোবাইল সম্পাদনা মোবাইল ওয়েব সম্পাদনা উচ্চতর মোবাইল সম্পাদনা |
ট্যাগ: মোবাইল সম্পাদনা মোবাইল ওয়েব সম্পাদনা উচ্চতর মোবাইল সম্পাদনা |
| (একই ব্যবহারকারী দ্বারা সম্পাদিত ১২টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না) |
| ১ নং লাইন: |
১ নং লাইন: |
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/রোলব্যাক নিশ্চিতকারক.js&action=raw&ctype=text/javascript'); |
| | mw.loader.load('//commons.m.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript'); |
| | |
| $(document).ready(function() { | | $(document).ready(function() { |
|
| |
|
| ২,৫০৫ নং লাইন: |
২,৫০৮ নং লাইন: |
| }); | | }); |
| }); | | }); |
| if(mw.config.get('wgCanonicalSpecialPageName') === 'MobileDiff') {
| | |
| mw.loader.using('mediawiki.util', function() {
| | //history |
| var ele_a = document.createElement('a');
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/মোবাইল পার্থক্য ইতিহাস.js&action=raw&ctype=text/javascript'); |
| ele_a.setAttribute('href', mw.util.getUrl(mw.config.get('wgRelevantPageName'), {action: 'history'}));
| |
| ele_a.innerHTML = '(ইতিহাস)';
| |
| document.getElementsByTagName('h2')[0].appendChild(ele_a);
| |
| });
| |
| }
| |
|
| |
|
| //my common.js | | //my common.js |
| ২,৫২২ নং লাইন: |
২,৫২০ নং লাইন: |
|
| |
|
| //শীর্ষক | | //শীর্ষক |
| (function($, mw) {
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/উপর নীচ.js&action=raw&ctype=text/javascript'); |
| var scrollDownButtonId = 'scrollDownButton',
| |
| scrollUpButtonId = 'scrollUpButton';
| |
| if (mw.config.get('wgServerName').match(/wikimirror\.org$/)) {
| |
| scrollDownButtonId += '-zhwiki';
| |
| scrollUpButtonId += '-zhwiki'
| |
| }
| |
| | |
| var scrollButtonIcon = '//upload.wikimedia.org/wikipedia/commons/7/7f/Font_Awesome_5_regular_arrow-circle-up_green.svg';
| |
| if (!document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'))
| |
| scrollButtonIcon = '//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Font_Awesome_5_regular_arrow-circle-up_green.svg/32px-Font_Awesome_5_regular_arrow-circle-up_green.svg.png';
| |
| | |
| $scrollDownButton = $('<img>', {
| |
| src: scrollButtonIcon,
| |
| id: scrollDownButtonId
| |
| }).css({
| |
| cursor: 'pointer',
| |
| opacity: 0.7,
| |
| position: 'fixed',
| |
| display: 'none',
| |
| right: '18px',
| |
| transform: 'rotate(180deg)',
| |
| '-webkit-transform': 'rotate(180deg)',
| |
| '-moz-transform': 'rotate(180deg)',
| |
| '-o-transform': 'rotate(180deg)',
| |
| '-ms-transform': 'rotate(180deg)'
| |
| }).on('click', function() {
| |
| $('html, body').animate({
| |
| scrollTop: $(document).height() - $(window).height()
| |
| }, 660)
| |
| }).on('mouseenter mouseleave', function(e) {
| |
| this.style.opacity = e.type === 'mouseenter' ? 1 : 0.7
| |
| }).appendTo('body');
| |
| | |
| $scrollUpButton = $('<img>', {
| |
| src: scrollButtonIcon,
| |
| id: scrollUpButtonId
| |
| }).css({
| |
| cursor: 'pointer',
| |
| opacity: 0.7,
| |
| position: 'fixed',
| |
| display: 'none',
| |
| right: '18px'
| |
| }).on('click', function() {
| |
| $('html, body').animate({
| |
| scrollTop: 0
| |
| }, 660)
| |
| }).on('mouseenter mouseleave', function(e) {
| |
| this.style.opacity = e.type === 'mouseenter' ? 1 : 0.7
| |
| }).appendTo('body');
| |
| | |
| var scrollButtonTimer;
| |
| $(window).on('scroll', function() {
| |
| var dingHeight = $('#bluedeck_ding>div').height() ? $('#bluedeck_ding>div').height() : 0;
| |
| $('#mw-ge-help-panel-cta-button').length > 0 ? $scrollDownButton.css('bottom', dingHeight + 75 + 'px') && $scrollUpButton.css('bottom', dingHeight + 116 + 'px') : $scrollDownButton.css('bottom', dingHeight + 24 + 'px') && $scrollUpButton.css('bottom', dingHeight + 65 + 'px');
| |
| $('#cat_a_lot').length > 0 || $('#proveit').length > 0 || $('.wordcount').length > 0 ? $scrollDownButton.css('left', '10px') && $scrollUpButton.css('left', '10px') : $scrollDownButton.css('left', 'unset') && $scrollUpButton.css('left', 'unset');
| |
| $(this).scrollTop() > 60 ? $scrollDownButton.fadeIn('slow') && $scrollUpButton.fadeIn('slow') : $scrollDownButton.fadeOut('slow') && $scrollUpButton.fadeOut('slow');
| |
| this.clearTimeout(scrollButtonTimer);
| |
| scrollButtonTimer = this.setTimeout(function() {
| |
| $scrollDownButton.fadeOut('slow');
| |
| $scrollUpButton.fadeOut('slow')
| |
| }, 2000)
| |
| });
| |
| $scrollDownButton.on('mouseenter', function() {
| |
| window.clearTimeout(scrollButtonTimer)
| |
| });
| |
| $scrollUpButton.on('mouseenter', function() {
| |
| window.clearTimeout(scrollButtonTimer)
| |
| })
| |
| })(jQuery, mw);
| |
| | |
| /** | |
| * Add "Purge" content action link.
| |
| *
| |
| * Dependencies: mediawiki.util, mediawiki.api
| |
| *
| |
| * @source https://www.mediawiki.org/wiki/Snippets/Purge_action
| |
| * @revision 2016-05-22
| |
| */
| |
| $( function () {
| |
| if ( $( '#ca-purge' ).length || !mw.config.get( 'wgIsArticle' ) ) return;
| |
| var node = mw.util.addPortletLink(
| |
| 'p-cactions',
| |
| mw.util.getUrl( null, { action: 'purge' } ),
| |
| mw.config.get( 'skin' ) === 'vector' ? 'শোধন' : 'শোধন',
| |
| 'ca-purge',
| |
| 'এই পাতার সার্ভার ক্যাশে পরিস্কার করুন',
| |
| 'শোধন'
| |
| );
| |
| $(node).on( 'click', function (e) {
| |
| new mw.Api().post( { action: 'purge', titles: mw.config.get( 'wgPageName' ) } ).then(function () {
| |
| location.reload();
| |
| }, function () {
| |
| mw.notify( 'শোধন ব্যর্থ হয়েছে', { type: 'error' } );
| |
| });
| |
| e.preventDefault();
| |
| });
| |
| });
| |
|
| |
|
| //rollback confirmation | | //Purge |
| //<nowiki>
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/পুনঃসতেজ.js&action=raw&ctype=text/javascript'); |
| (function() {
| |
| if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
| |
| $(".mw-rollback-link").on('click', function(e) {
| |
| var linkText = $(e.target).text(),
| |
| count = linkText.match(/\d/) ? linkText.match(/\d+/)[0] : null,
| |
| message = 'আপনি কি নিশ্চিত? রোলব্যাক ' + 'করছেন ' + mw.util.getParamValue('from',e.target.href) + ' কতৃক সম্পাদিত ' + (count ? count + ' edits' : 'সম্পাদনা') + '!';
| |
| if(!confirm(message)) return e.preventDefault();
| |
| });
| |
| }
| |
| }());
| |
| //</nowiki>
| |
|
| |
|
| /** Quick Edit **/ | | /** Quick Edit **/ |
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/দ্রুত সম্পাদনা.js&action=raw&ctype=text/javascript'); |
|
| |
|
| // Edit sections of a page without leaving the article | | //page creation |
| // [[en:w:User:BrandonXLF/QuickEdit]] | | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/পাতা সৃষ্টিকারক.js&action=raw&ctype=text/javascript'); |
| // By [[en:w:User:BrandonXLF]] | |
|
| |
|
| (function() {
| | //redirect fix |
| var mobile = mw.config.get('skin') === 'minerva',
| | $(function() { $('#mw-content-text .mw-redirect').after(function() { return this.href.indexOf('action=edit') !== -1 || this.href.indexOf('action=') !== -1 || this.href.indexOf('diff=') !== -1 ? '' : '<a href="' + this.href + (this.href.includes('?') ? '&' : '?') + 'action=edit" title="' + (this.title || this.href) + ' (edit redirect)"><sup>(→)</sup></a>'; }); }); |
| apiSingleton,
| |
| titleRegexp = new RegExp(
| |
| mw.config.get('wgArticlePath').replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/\\\$1/, '([^?]+)') +
| |
| '|[?&]title=([^&#]*)'
| |
| );
| |
| | |
| function api(func, params) {
| |
| if (!apiSingleton) apiSingleton = new mw.Api();
| |
| | |
| $.extend(params, {
| |
| errorformat: 'html',
| |
| errorlang: mw.config.get('wgUserLanguage'),
| |
| errorsuselocal: true
| |
| });
| |
| | |
| return apiSingleton[func](params).fail(function(_, data) {
| |
| mw.notify(apiSingleton.getErrorMessage(data), {
| |
| type: 'error',
| |
| tag: 'quickedit'
| |
| });
| |
| });
| |
| }
| |
| | |
| function getPageInfo(title, sectionID) {
| |
| return api('get', {
| |
| action: 'query',
| |
| curtimestamp: 1,
| |
| prop: 'revisions',
| |
| indexpageids: 1,
| |
| titles: title,
| |
| rvprop: ['timestamp', 'content'],
| |
| rvslots: 'main',
| |
| rvsection: sectionID
| |
| }).then(function(res) {
| |
| var rev = res.query.pages[res.query.pageids[0]].revisions[0];
| |
| | |
| return {
| |
| start: res.curtimestamp,
| |
| base: rev.timestamp,
| |
| full: rev.slots.main['*']
| |
| };
| |
| });
| |
| }
| |
| | |
| function getPreviewCallback(editor) {
| |
| editor.children('.preview').remove();
| |
| | |
| new OO.ui.ProgressBarWidget().$element.css({
| |
| maxWidth: '100%',
| |
| borderRadius: '0',
| |
| boxShadow: 'none',
| |
| margin: '8px 0'
| |
| }).addClass('preview').appendTo(editor);
| |
| | |
| return function(html) {
| |
| editor.children('.preview').remove();
| |
| | |
| $('<div>').html(html).css({
| |
| margin: '8px 0',
| |
| border: '1px solid #a2a9b1',
| |
| padding: '8px',
| |
| overflowX: 'hidden'
| |
| }).addClass('preview').appendTo(editor);
| |
| };
| |
| }
| |
| | |
| function showCompare(editor, title, from, to) {
| |
| mw.loader.load('mediawiki.diff.styles');
| |
| | |
| api('post', {
| |
| action: 'compare',
| |
| fromslots: 'main',
| |
| 'fromtext-main': from,
| |
| fromtitle: title,
| |
| frompst: 'true',
| |
| toslots: 'main',
| |
| 'totext-main': to,
| |
| totitle: title,
| |
| topst: 'true'
| |
| }).then(function(r) {
| |
| return r.compare['*'] ? $('<table>').addClass('diff').append(
| |
| $('<colgroup>').append(
| |
| $('<col>').addClass('diff-marker'),
| |
| $('<col>').addClass('diff-content'),
| |
| $('<col>').addClass('diff-marker'),
| |
| $('<col>').addClass('diff-content')
| |
| )
| |
| ).append(r.compare['*']) : 'কোন পার্থক্য নেই';
| |
| }).then(getPreviewCallback(editor));
| |
| }
| |
| | |
| // Parts taken from EditPage::extractSectionTitle and Parser::stripSectionName
| |
| function getSectionSummary(text) {
| |
| var match = text.match(/^(=+)(.+)\1\s*(\n|$)/);
| |
| | |
| return !match ? '' : '/* ' + match[2].trim()
| |
| // Strip internal link markup
| |
| .replace(/\[\[:?([^[|]+)\|([^[]+)\]\]/g, '$2')
| |
| .replace(/\[\[:?([^[]+)\|?\]\]/g, '$1')
| |
| // Strip external link markup
| |
| .replace(new RegExp('\\[(?:' + mw.config.get('wgUrlProtocols') + ')([^ ]+?) ([^\\[]+)\\]', 'ig'), '$2')
| |
| // Remove wikitext quotes
| |
| .replace(/(''|'''|''''')(?!')/g, '')
| |
| // Strip HTML tags
| |
| .replace(/<[^>]+?>/g, '') + ' */ ';
| |
| }
| |
| | |
| function showEditor(el) {
| |
| var progress = new OO.ui.ProgressBarWidget(),
| |
| heading = el.closest(':header'),
| |
| matcher = heading.nextUntil.bind(heading),
| |
| inserter = heading.after.bind(heading),
| |
| targetEl = el.siblings('.quickedit-target').last(),
| |
| titleMatch = targetEl.attr('href').match(titleRegexp),
| |
| title = decodeURIComponent(titleMatch[1] || titleMatch[2]),
| |
| sectionID = /[?&]v?e?section=T?-?(\d*)/.exec(targetEl.attr('href'))[1];
| |
| | |
| if (!heading.closest('.mw-parser-output').length) {
| |
| var articleContent = $('#mw-content-text .mw-parser-output');
| |
| | |
| matcher = function(selector) {
| |
| var child = articleContent.children(selector).first();
| |
| | |
| if (child.length) return child.prevAll();
| |
| return articleContent.children();
| |
| };
| |
| inserter = articleContent.prepend.bind(articleContent);
| |
| }
| |
| | |
| inserter(progress.$element.css({
| |
| maxWidth: '100%',
| |
| borderRadius: '0',
| |
| boxShadow: 'none'
| |
| }));
| |
| | |
| el.addClass('quickedit-loading');
| |
| $('.quickedit-hide').removeClass('quickedit-hide');
| |
| $('.quickedit-heading').removeClass('quickedit-heading');
| |
| $('#quickedit-editor').remove();
| |
| | |
| getPageInfo(title, sectionID).then(function(r) {
| |
| var start = r.start,
| |
| base = r.base,
| |
| full = r.full,
| |
| saving = false,
| |
| expanded = false,
| |
| remainderStart = full.match(/\n=+.+=+(?:\n|$)/),
| |
| part = remainderStart ? full.substring(0, remainderStart.index) : full,
| |
| remainder = remainderStart ? full.substring(remainderStart.index) : '',
| |
| level = 0,
| |
| editor;
| |
| | |
| full.replace(/^(=+).+?(=+)(?:\n|$)/, function(m, a, b) {
| |
| level = Math.min(a.length, b.length);
| |
| return m;
| |
| });
| |
| | |
| var levelMatch = 'h1';
| |
| for (var i = 2; i <= level; i++) levelMatch += ',h' + i + ':has(*)';
| |
| | |
| var partSection = matcher(':header:has(*)'),
| |
| fullSection = matcher(levelMatch),
| |
| textarea = new OO.ui.MultilineTextInputWidget({
| |
| rows: 1,
| |
| maxRows: 20,
| |
| autosize: true,
| |
| value: part
| |
| }),
| |
| summary = new OO.ui.TextInputWidget({
| |
| value: getSectionSummary(part)
| |
| }),
| |
| minor = new OO.ui.CheckboxInputWidget(),
| |
| save = new OO.ui.ButtonInputWidget({
| |
| label: 'পরিবর্তন প্রকাশ করুন',
| |
| title: 'Save your changes',
| |
| flags: ['primary', 'progressive']
| |
| }),
| |
| preview = new OO.ui.ButtonInputWidget({
| |
| label: 'প্রাকদর্শন',
| |
| title: 'Preview the new wikitext'
| |
| }),
| |
| compare = new OO.ui.ButtonInputWidget({
| |
| label: 'পরিবর্তনসমূহ',
| |
| title: 'View the difference between the current revision and your revision'
| |
| }),
| |
| cancel = new OO.ui.ButtonInputWidget({
| |
| useInputTag: true,
| |
| label: 'বাতিল',
| |
| title: 'Close the edit form and discard changes',
| |
| flags: ['secondary', 'destructive']
| |
| }),
| |
| more = new OO.ui.ButtonInputWidget({
| |
| label: '+',
| |
| title: 'Edit the entire section (including subsections)'
| |
| }),
| |
| buttons = new OO.ui.HorizontalLayout({
| |
| items: [save, preview, compare, cancel]
| |
| });
| |
| | |
| if (part != full) {
| |
| buttons.addItems([more], 3);
| |
| }
| |
| | |
| partSection.addClass('quickedit-hide');
| |
| heading.addClass('quickedit-heading');
| |
| el.removeClass('quickedit-loading');
| |
| progress.$element.remove();
| |
| textarea.$input.css({
| |
| borderRadius: '0'
| |
| });
| |
| | |
| summary.on('enter', function() {
| |
| save.emit('click');
| |
| });
| |
| | |
| save.on('click', function() {
| |
| if (saving) return;
| |
| | |
| var fullText = textarea.getValue() + (expanded ? '' : remainder);
| |
| saving = true;
| |
| save.setLabel('সংরক্ষণ করা হচ্ছে...');
| |
| compare.setDisabled(true);
| |
| preview.setDisabled(true);
| |
| cancel.setDisabled(true);
| |
| more.setDisabled(true);
| |
| | |
| api('postWithEditToken', {
| |
| action: 'edit',
| |
| title: title,
| |
| section: sectionID,
| |
| summary: summary.getValue(),
| |
| text: fullText,
| |
| minor: minor.isSelected() ? true : undefined,
| |
| notminor: minor.isSelected() ? undefined : true,
| |
| starttimestamp: start,
| |
| basetimestamp: base
| |
| }).then(function() {
| |
| api('get', {
| |
| action: 'parse',
| |
| page: mw.config.get('wgPageName'),
| |
| prop: ['text', 'categorieshtml']
| |
| }).then(function(r) {
| |
| var contentText = $('#mw-content-text'),
| |
| catLinks = $('#catlinks');
| |
| | |
| contentText.find('.mw-parser-output').replaceWith(r.parse.text['*']);
| |
| mw.hook('wikipage.content').fire(contentText);
| |
| | |
| catLinks.replaceWith(r.parse.categorieshtml['*']);
| |
| mw.hook('wikipage.categories').fire(catLinks);
| |
| | |
| saving = false;
| |
| });
| |
| }, function(code) {
| |
| if (code == 'editconflict') {
| |
| showEditConflict(editor, title, sectionID, fullText).then(function(r) {
| |
| start = r.start;
| |
| base = r.base;
| |
| textarea = r.textarea;
| |
| expanded = true;
| |
| });
| |
| }
| |
| | |
| compare.setDisabled(false);
| |
| preview.setDisabled(false);
| |
| cancel.setDisabled(false);
| |
| more.setDisabled(expanded);
| |
| saving = false;
| |
| save.setLabel('Save');
| |
| });
| |
| });
| |
| | |
| preview.on('click', function() {
| |
| api('post', {
| |
| action: 'parse',
| |
| title: title,
| |
| prop: 'text',
| |
| pst: 'true',
| |
| disablelimitreport: 'true',
| |
| disableeditsection: 'true',
| |
| sectionpreview: 'true',
| |
| disabletoc: 'true',
| |
| text: textarea.getValue()
| |
| }).then(function(r) {
| |
| return r.parse.text['*'] + '<div style="clear:both;"></div>';
| |
| }).then(getPreviewCallback(editor));
| |
| });
| |
| | |
| compare.on('click', function() {
| |
| showCompare(editor, title, part + (expanded ? remainder : ''), textarea.getValue());
| |
| });
| |
| | |
| cancel.on('click', function() {
| |
| editor.remove();
| |
| heading.removeClass('quickedit-heading');
| |
| fullSection.removeClass('quickedit-hide');
| |
| });
| |
| | |
| more.on('click', function() {
| |
| expanded = true;
| |
| textarea.setValue(textarea.getValue() + remainder);
| |
| fullSection.addClass('quickedit-hide');
| |
| more.setDisabled(true);
| |
| });
| |
| | |
| editor = $('<div id="quickedit-editor">').css({
| |
| overflowX: 'hidden'
| |
| }).append(
| |
| $('<div>').css({
| |
| backgroundColor: '#eaecf0',
| |
| borderBottom: '1px solid #a2a9b1',
| |
| marginBottom: '8px'
| |
| }).append(
| |
| textarea.$element.css({
| |
| width: '100%',
| |
| maxWidth: '100%',
| |
| fontFamily: 'monospace, monospace'
| |
| }).addClass('quickedit-textarea'),
| |
| $('<div>').css({
| |
| border: '1px solid #a2a9b1',
| |
| borderWidth: '0 1px'
| |
| }).append(
| |
| $('<div>').css({
| |
| padding: '8px 4px 8px 8px',
| |
| display: 'table-cell',
| |
| verticalAlign: 'middle'
| |
| }).html('সারাংশ:'),
| |
| summary.$element.css({
| |
| width: '100%',
| |
| maxWidth: '100%',
| |
| padding: '8px 0px',
| |
| display: 'table-cell',
| |
| verticalAlign: 'middle'
| |
| }),
| |
| new OO.ui.FieldLayout(minor, {
| |
| label: new OO.ui.HtmlSnippet('🤏?'),
| |
| align: 'inline'
| |
| }).$element.css({
| |
| padding: '8px 8px 8px 4px',
| |
| display: 'table-cell',
| |
| verticalAlign: 'middle'
| |
| })
| |
| ),
| |
| buttons.$element.css({
| |
| border: '1px solid #a2a9b1',
| |
| borderWidth: '0 1px',
| |
| padding: '0px 8px 0'
| |
| }),
| |
| title !== mw.config.get('wgPageName') ? $('<div>').css({
| |
| border: '1px solid #a2a9b1',
| |
| borderWidth: '0 1px',
| |
| padding: '0px 8px 8px'
| |
| }).append(
| |
| 'Editing page: ',
| |
| $('<a>').attr('href', mw.config.get('wgArticlePath').replace('$1', title)).css({
| |
| fontWeight: 'bold'
| |
| }).text(title.replace(/_/g, ' '))
| |
| ) : undefined
| |
| )
| |
| );
| |
| | |
| inserter(editor);
| |
| }, function() {
| |
| el.removeClass('quickedit-loading');
| |
| progress.$element.remove();
| |
| });
| |
| }
| |
| | |
| function showEditConflict(editor, title, sectionID, text) {
| |
| return getPageInfo(title, sectionID).then(function(r) {
| |
| var textarea = new OO.ui.MultilineTextInputWidget({
| |
| rows: 1,
| |
| maxRows: 20,
| |
| autosize: true,
| |
| value: r.full
| |
| }),
| |
| textarea2 = new OO.ui.MultilineTextInputWidget({
| |
| rows: 1,
| |
| maxRows: 20,
| |
| autosize: true,
| |
| value: text,
| |
| });
| |
| | |
| function syncSize() {
| |
| textarea.styleHeight = -1;
| |
| textarea.adjustSize(true);
| |
| | |
| textarea2.styleHeight = -1;
| |
| textarea2.adjustSize(true);
| |
| | |
| var height = Math.max(textarea.$input.height(), textarea2.$input.height());
| |
| textarea.$input.height(height);
| |
| textarea2.$input.height(height);
| |
| }
| |
| | |
| textarea.$input.css({
| |
| borderRadius: '0'
| |
| });
| |
| editor.find('> :first-child > :first-child').remove();
| |
| | |
| $('<table>').css({
| |
| width: '100%',
| |
| border: '1px solid #a2a9b1',
| |
| borderBottom: 'none',
| |
| borderSpacing: '0',
| |
| margin: '0 !important'
| |
| }).append(
| |
| $('<tr>').append(
| |
| $('<th>').css({
| |
| width: '50%',
| |
| paddingTop: '4px'
| |
| }).text('Their version (to be saved)'),
| |
| $('<th>').css({
| |
| width: '50%',
| |
| paddingTop: '4px'
| |
| }).text('Your version')
| |
| ),
| |
| $('<tr>').append(
| |
| $('<td>').css({
| |
| width: '50%',
| |
| padding: '4px 4px 0 8px'
| |
| }).append(
| |
| textarea.$element.css({
| |
| width: '100%',
| |
| maxWidth: '100%',
| |
| fontFamily: 'monospace, monospace'
| |
| })
| |
| ),
| |
| $('<td>').css({
| |
| width: '50%',
| |
| padding: '4px 8px 0 4px'
| |
| }).append(
| |
| textarea2.$element.css({
| |
| width: '100%',
| |
| maxWidth: '100%',
| |
| fontFamily: 'monospace, monospace'
| |
| })
| |
| )
| |
| )
| |
| ).prependTo(editor.find('> :first-child'));
| |
| | |
| textarea.on('change', syncSize);
| |
| textarea2.on('change', syncSize);
| |
| syncSize();
| |
| showCompare(editor, title, text, r.full);
| |
| | |
| r.textarea = textarea;
| |
| return r;
| |
| });
| |
| }
| |
| | |
| function clickHandler(e) {
| |
| var el = $(e.target);
| |
| | |
| if (!el.hasClass('quickedit-editlink') || el.hasClass('quickedit-loading')) return;
| |
| | |
| e.preventDefault();
| |
| | |
| showEditor(el);
| |
| }
| |
| | |
| function addLinksToChildren(element) {
| |
| element.find('#quickedit-editor, .quickedit-section').remove();
| |
| element.find('.mw-editsection').each(function() {
| |
| $('[href*="section="]', this).last().after(
| |
| mobile ? '' : '<span class="quickedit-section"> | </span>',
| |
| $('<a>').html(mobile ? ' 💨' : 'দ্রুত সম্পাদনা').addClass('quickedit-section quickedit-editlink')
| |
| ).addClass('quickedit-target');
| |
| });
| |
| }
| |
| | |
| $.when(mw.loader.using('oojs-ui-core'), $.ready).done(function() {
| |
| var body = $(document.body);
| |
| | |
| body.on('click', clickHandler);
| |
| addLinksToChildren(body);
| |
| mw.hook('wikipage.content').add(addLinksToChildren);
| |
| });
| |
| | |
| mw.loader.addStyleTag(
| |
| '.skin-minerva .mw-editsection { white-space: nowrap; }' +
| |
| '.skin-minerva .content .collapsible-heading .quickedit-section { visibility: hidden; }' +
| |
| '.skin-minerva .content .collapsible-heading.open-block .quickedit-section { visibility: visible; }' +
| |
| '.quickedit-hide { display: none !important; }' +
| |
| '.quickedit-loading, .quickedit-heading { color: #777; }'
| |
| );
| |
| })();
| |
| | |
| //খেলাঘর
| |
| $( document ).ready( function() {
| |
| mw.util.addPortletLink(
| |
| 'p-personal',
| |
| mw.util.getUrl( 'Special:MyPage/খেলাঘর' ), //No need for a variable.
| |
| 'খেলাঘর',
| |
| 'pt-sandbox2',
| |
| 'খেলাঘর',
| |
| null,
| |
| '#pt-sandbox'
| |
| );
| |
| });
| |
| | |
| //article creation
| |
| | |
| | |
| (function() {
| |
| $(document).ready(function() {
| |
| mw.loader.using( ['mediawiki.util'], function() {
| |
| {
| |
| var L=mw.util.addPortletLink("p-navigation", "#", "নতুন পাতা তৈরি");L.addEventListener("click", create);
| |
|
| |
| return;
| |
| }
| |
| });
| |
| });
| |
| }());
| |
| function create() {
| |
| var art = prompt ("যে নিবন্ধটি তৈরি করতে চান তার নাম লিখুন:");
| |
| switch (art) {
| |
| case null:
| |
| case undefined:
| |
| case '':
| |
| //Do nothing
| |
| break;
| |
| default:
| |
| {
| |
| window.open('/index.php?preload=Special:New_page&editintro=&title=' + art + '&create=Create+page#/editor/all', '_blank');
| |
| }
| |
| }
| |
| | |
| | |
| }
| |
| | |
| //redirect fix | |
| $(function() { $('#mw-content-text .mw-redirect').after(function() { return this.href.indexOf('action=edit') !== -1 || this.href.indexOf('action=') !== -1 || this.href.indexOf('diff=') !== -1 ? '' : '<a href="' + this.href + (this.href.includes('?') ? '&' : '?') + 'action=edit" title="' + (this.title || this.href) + ' (edit redirect)"><sup>(→)</sup></a>'; }); }); | |
| | |
| // FastButtons
| |
| // <nowiki>
| |
| | |
| var pagina = '',
| |
| mot = '',
| |
| txt = '',
| |
| botones = '',
| |
| usuario = '',
| |
| temporal = '',
| |
| sep = "|",
| |
| biblio = false,
| |
| ufb = '. ([[User:MC10/FastButtons.js|FBs]])',
| |
| dire = "//bn.bharatpedia.org/index.php?title=",
| |
| fin_otro = "edit&borrar=otro-",
| |
| fin_aviso = "edit&aviso=",
| |
| textopruebas = "Warn user:\n—Vandalism:\n1: Level 1\n2: Level 2\n3: Level 3\n4: Level 4\n4im: Level 4im\n \nAdditionally, you may add the article name\nfollowed by a |",
| |
| FBpersonal = false, // Personal configuration
| |
| FBpruebas = true, // Test edits
| |
| FBblanco = true, // Vandalism
| |
| FBne = true, // Nonsense pages
| |
| FBinfra = true, // Attack pages
| |
| FBautopromo = true, // Promotional
| |
| FBbio = true, // A7
| |
| FBband = true, // A7
| |
| FBweb = true, // A7
| |
| FBinc = true, // Nonsense pages
| |
| FBotro = true, // Custom CSD
| |
| FBcommons = true, // Now Commons
| |
| FBimfu = true, // No fair use rationale
| |
| FBwikify = true, // Wikify
| |
| FBunref = true, // Unreferenced
| |
| FBcleanup = true, // Cleanup
| |
| FBnpov = true, // POV
| |
| FBglobal = true, // Globalize
| |
| FBcedit = true, // Copyedit
| |
| FBborrar = false, // Speedy delete (test)
| |
| FBaviso = true, // Warn user
| |
| FBwelcome = false; // Welcome user
| |
| | |
| // All data is here:
| |
| for (i = 0; i < mw.config.get("wgUserGroups").length; i++) {
| |
| if (mw.config.get("wgUserGroups")[i] === "sysop") biblio = true;
| |
| }
| |
| | |
| for (i = 0; i < mw.config.get("wgUserGroups").length; i++) {
| |
| if (mw.config.get("wgUserGroups")[i] === "autoconfirmed") autoconfirmed = true;
| |
| }
| |
| | |
| pagina = encodeURI(mw.config.get("wgPageName"));
| |
| if (pagina.match("&")) {
| |
| pagina = pagina.replace("&", "%26");
| |
| }
| |
| dire = dire + pagina + "&action=";
| |
| usuario = pagina.split(":")[1];
| |
| | |
| | |
| if (pagina === "Special:Contributions") {
| |
| usuario = location.href.substring(location.href.indexOf('Contributions/') + 14, location.href.length);
| |
| }
| |
| | |
| // Start
| |
| if (biblio) {
| |
| tmp = '';
| |
| | |
| if (FBborrar) {
| |
| tmp += '[<a href=' + dire + 'delete&rapido=si>speedy delete!</a>] ';
| |
| }
| |
| | |
| if (tmp !== '') {
| |
| botones = botones + 'Sysop buttons: ' + tmp + '<br>';
| |
| }
| |
| }
| |
| | |
| if (!biblio && autoconfirmed) {
| |
| tmp = '';
| |
| | |
| if (mw.config.get("wgNamespaceNumber") === 0) {
| |
| if (FBpruebas) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=blanco>test</a>] ';
| |
| }
| |
| if (FBblanco) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=pruebas>vandalism</a>] ';
| |
| }
| |
| if (FBne) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=NE>nonsense</a>] ';
| |
| }
| |
| if (FBinfra) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=infra>attack</a>] ';
| |
| }
| |
| if (FBautopromo) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=autopromo>promotional</a>] ';
| |
| }
| |
| if (FBotro) {
| |
| tmp += '[<a onclick="mot=prompt(/Enter reason:/);location.href=dire + fin_otro +encodeURI(mot) ;"> other </a>] ';
| |
| }
| |
| if (FBbio) {
| |
| tmp += '/ A7: <b>[</b><a href=' + dire + 'edit&borrar=bio>person</a> ';
| |
| }
| |
| if (FBband) {
| |
| tmp += '| <a href=' + dire + 'edit&borrar=band>band</a> ';
| |
| }
| |
| if (FBweb) {
| |
| tmp += '| <a href=' + dire + 'edit&borrar=web>web</a> ';
| |
| }
| |
| if (FBinc) {
| |
| tmp += '| <a href=' + dire + 'edit&borrar=inc>inc</a><b>]</b> ';
| |
| }
| |
| } else if (mw.config.get("wgNamespaceNumber") === 6) {
| |
| if (FBimfu) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=norat>no fair use</a>] ';
| |
| }
| |
| if (FBcommons) {
| |
| tmp += '[<a href=' + dire + 'edit&borrar=commons>commons</a>] ';
| |
| }
| |
| }
| |
| | |
| if (tmp !== '') {
| |
| botones = botones + 'CSD: ' + tmp + '<br>';
| |
| }
| |
| }
| |
| | |
| | |
| tmp = '';
| |
| | |
| if (mw.config.get("wgNamespaceNumber") === 0 || mw.config.get("wgNamespaceNumber") === 1) {
| |
| if (FBwikify) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=wikify>wikify</a>] ';
| |
| }
| |
| if (FBunref) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=unref>unreferenced</a>] ';
| |
| }
| |
| if (FBcleanup) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=cleanup>cleanup</a>] ';
| |
| }
| |
| if (FBnpov) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=npov>POV</a>] ';
| |
| }
| |
| if (FBglobal) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=global>globalize</a>] ';
| |
| }
| |
| if (FBcedit) {
| |
| tmp += '[<a href=' + dire + 'edit&plant=cedit>copyedit</a>] ';
| |
| }
| |
| }
| |
| | |
| if (tmp !== '') {
| |
| botones = botones + 'Templates: ' + tmp + '<br>';
| |
| }
| |
| | |
| tmp = '';
| |
| | |
| if (mw.config.get("wgNamespaceNumber") === 3) {
| |
| if (FBaviso) {
| |
| tmp += '[<a onclick="mot=prompt(textopruebas);location.href=dire + fin_aviso +encodeURI(mot) ;">warn user</a>] ';
| |
| }
| |
| | |
| if (FBwelcome) {
| |
| tmp += '[<a href="' + dire + 'edit&plant=welcome">welcome</a>] ';
| |
| }
| |
| }
| |
| | |
| if (tmp !== '') {
| |
| botones = botones + 'Special: ' + tmp + '<br>';
| |
| }
| |
| | |
| /* Botones funcionando */
| |
| | |
| $(function () {
| |
| if (document.getElementById('contentSub').innerHTML != '') {
| |
| document.getElementById('contentSub').innerHTML += '<br>';
| |
| }
| |
| | |
| document.getElementById('contentSub').innerHTML = document.getElementById('contentSub').innerHTML + botones;
| |
| | |
| if (location.href.match("borrar=blanco")) {
| |
| txt = document.getElementById("wpTextbox1").value;
| |
| if (!(txt.match("\{db"))) {
| |
| txt = '\{\{db-test}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion G2' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=pruebas")) {
| |
| txt = document.getElementById("wpTextbox1").value;
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-vandalism}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion G3' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=NE")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-nonsense}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion G1' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=infra")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-attack}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion G10' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=autopromo")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-g11}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion G11' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=otro")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| mot = location.href.substring(location.href.indexOf('otro-') + 5, location.href.length)
| |
| if (mot != null) {
| |
| txt = '\{\{delete|' + decodeURI(mot) + '}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| }
| |
| } else if (location.href.match("borrar=norat")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-i8}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion I8' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=commons")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-i6}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion I6' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=bio")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-person}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion A7' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=band")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-band}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion A7' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=web")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{db")) && (txt !== "")) {
| |
| txt = '\{\{db-web}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion A7' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("borrar=inc")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("{db")) && (txt !== "")) {
| |
| txt = '\{\{db-inc}}\n' + txt
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Requesting speedy deletion A7' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("plant=wikify")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{wikify")) && (txt !== "")) {
| |
| txt = '\{\{wikify|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{wikify}}' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("plant=unref")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{unreferenced")) && (txt !== "")) {
| |
| txt = '\{\{unreferenced|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{unreferenced}}' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("plant=cleanup")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("{cleanup")) && (txt !== "")) {
| |
| txt = '\{\{cleanup|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{cleanup}}' + ufb;
| |
| document.editform.wpSave.click();
| |
| }
| |
| } else if (location.href.match("plant=npov")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{POV")) && (txt !== "")) {
| |
| txt = '\{\{POV|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{POV}}' + ufb;
| |
| document.editform.wpSave.click();
| |
| }
| |
| } else if (location.href.match("plant=global")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{globalize")) && (txt !== "")) {
| |
| txt = '\{\{globalize|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{globalize}}' + ufb;
| |
| document.editform.wpSave.click();
| |
| }
| |
| } else if (location.href.match("plant=cedit")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{copyedit")) && (txt !== "")) {
| |
| txt = '\{\{copyedit|date=October 2011}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Tagged with \{\{copyedit}}' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("plant=welcome")) {
| |
| txt = document.getElementById("wpTextbox1").value
| |
| if (!(txt.match("\{welcome"))) {
| |
| txt = '\{\{subst:User:MC10/Welcome}}\n' + txt;
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Welcoming user' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| } else if (location.href.match("rapido=si")) {
| |
| document.getElementById("wpConfirmB").click();
| |
| } else if (location.href.match("aviso=")) {
| |
| txt = document.getElementById("wpCombobox1").value;
| |
| mot = location.href.substring(location.href.indexOf('aviso=') + 6, location.href.length);
| |
| txt = txt + '\n\n\{\{subst:uw-vandalism' + decodeURI(mot) + '}} --\~\~\~\~';
| |
| document.getElementById("wpTextbox1").value = txt;
| |
| document.editform.wpSummary.value = 'Warning user' + ufb;
| |
| document.editform.submit();
| |
| }
| |
| });
| |
| | |
| // Special FastButtons start here
| |
| // Edit count FastButton
| |
| $(function () {
| |
| if (mw.config.get("wgTitle").indexOf("/") !== -1 || document.title.indexOf("- History -") !== -1) // no subpages or history
| |
| return;
| |
| if (mw.config.get("wgCanonicalNamespace") === "User" || mw.config.get("wgCanonicalNamespace") === "User_talk") {
| |
| var username = encodeURIComponent(mw.config.get("wgTitle"));
| |
| var checkurl = "//toolserver.org/~soxred93/count/index.php?name=" + username + "&lang=en&wiki=wikipedia";
| |
| | |
| mw.util.addPortletLink("p-cactions", checkurl, "edc", "ca-contrib", "View edit count by this user");
| |
| }
| |
| });
| |
| | |
| // Special:PrefixIndex FastButton
| |
| $(function () {
| |
| if (mw.config.get("wgTitle").indexOf("/") !== -1 || document.title.indexOf("- History -") !== -1) // no subpages or history
| |
| return;
| |
| if (mw.config.get("wgCanonicalNamespace") === "User" || mw.config.get("wgCanonicalNamespace") === "User_talk") {
| |
| var username = encodeURIComponent(mw.config.get("wgTitle"));
| |
| var checkurl = mw.config.get("wgServer") + "/w/index.php?title=Special:PrefixIndex&prefix=" + username + "&namespace=2";
| |
| | |
| mw.util.addPortletLink("p-cactions", checkurl, "all pages", "ca-contrib", "List of pages by this user");
| |
| }
| |
| }); | |
|
| |
|
| // </nowiki> | | //cleanup |
| | mw.loader.load('//bn.bharatpedia.org/index.php?title=ব্যবহারকারী:রবি/পরিষ্কারকরণ.js&action=raw&ctype=text/javascript'); |