۱۰۷
ویرایش
جز (۱ نسخه واردشده) |
جز (۱ نسخه واردشده) |
||
(۲ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
خط ۳: | خط ۳: | ||
* morebits.js | * morebits.js | ||
* =========== | * =========== | ||
* A library full of lots of goodness for user scripts on MediaWiki wikis, including | * 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 [[ | * 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. | * **************** Morebits.Iranpedia **************** | ||
* English | * English Iranpedia-specific objects | ||
*/ | */ | ||
Morebits. | Morebits.Iranpedia = {}; | ||
Morebits. | Morebits.Iranpedia.namespaces = { | ||
'-2': 'Media', | '-2': 'Media', | ||
'-1': 'Special', | '-1': 'Special', | ||
خط ۱٬۲۶۹: | خط ۱٬۲۶۹: | ||
}; | }; | ||
Morebits. | Morebits.Iranpedia.namespacesFriendly = { | ||
'0': '(Article)', | '0': '(Article)', | ||
'1': 'Talk', | '1': 'Talk', | ||
'2': 'User', | '2': 'User', | ||
'3': 'User talk', | '3': 'User talk', | ||
'4': ' | '4': 'Iranpedia', | ||
'5': ' | '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 | 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 | // 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 | 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 | ||
Iranpedia_api.post(); | |||
} | } | ||
}; | }; | ||
خط ۳٬۶۴۷: | خط ۳٬۶۴۷: | ||
// Twinkle blacklist was removed per consensus at http://en. | // 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. | window.Iranpedia = Morebits.wiki; | ||
window.Status = Morebits.status; | window.Status = Morebits.status; | ||
window.QueryString = Morebits.queryString; | window.QueryString = Morebits.queryString; |