مدیاویکی:Gadget-morebits-test.js: تفاوت میان نسخه‌ها

هیچ تغییری در اندازه به وجود نیامده‌ است. ،  ‏۲ دسامبر ۲۰۱۷
جز
۱ نسخه واردشده
جز (۱ نسخه واردشده)
 
جز (۱ نسخه واردشده)
 
(۲ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۳: خط ۳:
  * morebits.js
  * morebits.js
  * ===========
  * ===========
  * A library full of lots of goodness for user scripts on MediaWiki wikis, including Wikipedia.
  * A library full of lots of goodness for user scripts on MediaWiki wikis, including Iranpedia.
  *
  *
  * The highlights include:
  * The highlights include:
خط ۲۵: خط ۲۵:
  *
  *
  * This library is maintained by the maintainers of Twinkle.
  * This library is maintained by the maintainers of Twinkle.
  * For queries, suggestions, help, etc., head to [[Wikipedia talk:Twinkle]] on English Wikipedia [http://en.wikipedia.org].
  * For queries, suggestions, help, etc., head to [[Iranpedia talk:Twinkle]] on English Iranpedia [http://en.Iranpedia.org].
  * The latest development source is available at [https://github.com/azatoth/twinkle/blob/master/morebits.js].
  * The latest development source is available at [https://github.com/azatoth/twinkle/blob/master/morebits.js].
  */
  */
خط ۱٬۲۳۰: خط ۱٬۲۳۰:


/**
/**
  * **************** Morebits.wikipedia ****************
  * **************** Morebits.Iranpedia ****************
  * English Wikipedia-specific objects
  * English Iranpedia-specific objects
  */
  */


Morebits.wikipedia = {};
Morebits.Iranpedia = {};


Morebits.wikipedia.namespaces = {
Morebits.Iranpedia.namespaces = {
'-2':  'Media',
'-2':  'Media',
'-1':  'Special',
'-1':  'Special',
خط ۱٬۲۶۹: خط ۱٬۲۶۹:
};
};


Morebits.wikipedia.namespacesFriendly = {
Morebits.Iranpedia.namespacesFriendly = {
'0':  '(Article)',
'0':  '(Article)',
'1':  'Talk',
'1':  'Talk',
'2':  'User',
'2':  'User',
'3':  'User talk',
'3':  'User talk',
'4':  'Wikipedia',
'4':  'Iranpedia',
'5':  'Wikipedia talk',
'5':  'Iranpedia talk',
'6':  'File',
'6':  'File',
'7':  'File talk',
'7':  'File talk',
خط ۱٬۳۱۱: خط ۱٬۳۱۱:
// Determines whether the current page is a redirect or soft redirect
// Determines whether the current page is a redirect or soft redirect
// (fails to detect soft redirects on edit, history, etc. pages)
// (fails to detect soft redirects on edit, history, etc. pages)
Morebits.wiki.isPageRedirect = function wikipediaIsPageRedirect() {
Morebits.wiki.isPageRedirect = function IranpediaIsPageRedirect() {
return !!(mw.config.get("wgIsRedirect") || document.getElementById("softredirect"));
return !!(mw.config.get("wgIsRedirect") || document.getElementById("softredirect"));
};
};
خط ۱٬۹۶۷: خط ۱٬۹۶۷:
};
};


// Save updated .pageText to Wikipedia
// Save updated .pageText to Iranpedia
// Only valid after successful .load()
// Only valid after successful .load()
this.save = function(onSuccess, onFailure) {
this.save = function(onSuccess, onFailure) {
خط ۲٬۱۲۳: خط ۲٬۱۲۳:
var patrolstat = new Morebits.status( 'Marking page as patrolled' );
var patrolstat = new Morebits.status( 'Marking page as patrolled' );


var wikipedia_api = new Morebits.wiki.api( 'doing...', {
var Iranpedia_api = new Morebits.wiki.api( 'doing...', {
action: 'patrol',
action: 'patrol',
rcid: rcid,
rcid: rcid,
خط ۲٬۱۳۰: خط ۲٬۱۳۰:


// We don't really care about the response
// We don't really care about the response
wikipedia_api.post();
Iranpedia_api.post();
}
}
};
};
خط ۳٬۶۴۷: خط ۳٬۶۴۷:




// Twinkle blacklist was removed per consensus at http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard/Archive221#New_Twinkle_blacklist_proposal
// Twinkle blacklist was removed per consensus at http://en.Iranpedia.org/wiki/Iranpedia:Administrators%27_noticeboard/Archive221#New_Twinkle_blacklist_proposal




خط ۳٬۶۶۶: خط ۳٬۶۶۶:
window.SimpleWindow = Morebits.simpleWindow;
window.SimpleWindow = Morebits.simpleWindow;
window.QuickForm = Morebits.quickForm;
window.QuickForm = Morebits.quickForm;
window.Wikipedia = Morebits.wiki;
window.Iranpedia = Morebits.wiki;
window.Status = Morebits.status;
window.Status = Morebits.status;
window.QueryString = Morebits.queryString;
window.QueryString = Morebits.queryString;