Extension:Gadgets/ar

يقدم امتداد Gadgets سبيل للمستخدمين يمكنهم من اختيار «نبيطات» مبنية على جافا سكريبت أو سي إس إس التي تقدمها مستخدمي موقع الويكي الآخرين.

تصمم النبيطات باستخدام قصاصات جافا سكريبت أو سي إس إس أو كلاهما موجودة في صفحات على نطاق الاسم ميدياويكي. تحدد كل نبيطة باستخدام سطر في MediaWiki:Gadgets-definition، يقدم اسم وبيان للنبيطة، وقائمة بقصاصات جافا سكريبت وسي إس إس التي تستعين بها (طالع فقرة  الاستخدام التالية).

منذ أن النبيطات تضاف إلى نطاق الاسم ميدياويكي (حيث توجد كلا من القائمة التي تحدد النبيطات وقصاصات الكود البرمجي ذاتها)، يمكن فقط لإداري النظام (وكذلك إداري الواجهة بدءا من الإصدار 1.32) تعديل الكود البرمجي. يتعين أن يكون الأمر كما يلي: يمنح فقط المستخدمين الذين يحظون بثقة مجتمع الويكي المتينة صلاحية تعديل كود جافا سكريبت البرمجي الذي يستخدمه المستخدمين الآخرين، منذ أنه يسهل استخدام جافا سكريبت في قرصنة الحسابات أو التلصص على الأفراد.

الاستخدام
There are two ways to define gadgets depending on the. If It is (the default value), the list of available gadgets is defined on MediaWiki:Gadgets-definition. In an alternative way, Gadget definitions defined on pages in the Gadget definition namespace when  is set to. CAUTION: Migration of the existing gadget definitions is not yet supported, So you will lose previously defined gadgets after changing this option.

Once created with at least one valid gadget, gadgets defined there show up in the "Gadgets" section of Special:Preferences, so users can pick the gadgets they would like to use. An overview of the gadgets defined by MediaWiki:Gadgets-definition is also shown on Special:Gadgets, along with links to the respective system messages, for easy editing. Statistics for non-default gadget usage can be seen at Special:GadgetUsage.

استخدام تعريف نبيطات ميدياويكي
Each line in MediaWiki:Gadgets-definition that starts with one or more "*" (asterisks) characters defines a gadget; it must have the following form: * gadget_name [options (can be omitted)] | page names

The first field (" gadget_name " in the example) is the gadget's internal name, and references a system message (MediaWiki:Gadget- gadget_name  in the example) that contains a short description of the gadget, using wiki syntax.

Options format: [option1 | option2 | ... optionN] whitespace can be omitted. A single option can either consist of a single option name (in this case it is a flag option), or contain a comma-separated list of values: option = value1, value2, value3

Examples: * mygadget|mygadget.js|mygadget.css or * mygadget[ResourceLoader]|mygadget.js|mygadget.css or * mygadget[rights=foo,bar]|mygadget.js|mygadget.css or * mygadget[ ResourceLoader | rights=foo, bar ] | mygadget.js | mygadget.css

Using Gadget Definition Namespace
Creation of the Gadget definition:Mygadget page and putting in it the below JSON code have the same effect as.

In above example, the Gadget:Mygadget.js and the Gadget:mygadget.css are used. And remember the  option is always true in the gadget definition namespace.

خيارات
You can specify extra dependencies for your gadgets, for example: * mygadget[ResourceLoader|dependencies=jquery.ui, jquery.effects.clip]|mygadget.js|mygadget.css

Here, we ask ResourceLoader to load modules  and   with mygadget. Note that gadgets can't depend on scripts from pages, static files or external URLs, only on modules already registered in ResourceLoader. To make a script from a page depend on another script from a page, each should be a gadget which registers itself as a module in ResourceLoader, then they can be made to have dependencies using the following syntax: * childgadget[ResourceLoader|dependencies=ext.gadget.parentgadget]|childgadget.js

To enable a gadget by default, use " ": * mygadget[ResourceLoader|default|dependencies=mediawiki.util]|mygadget.js|mygadget.css

To make the gadget available only to users with appropriate permissions, set the  option. For example, * ImprovedDeletion [rights=delete] | ImprovedDeletion.js makes the gadget available only to users who can actually delete pages. Note that restrictions are based on permissions, not user groups like administrators or bureaucrats. Here are some real examples: * modrollback[ResourceLoader|rights=rollback]|modrollback.js * UTCLiveClock[ResourceLoader|rights=purge]|UTCLiveClock.js * Ajax_sysop[ResourceLoader|rights=patrol,rollback,markbotedits,delete]|Ajax_sysop.js

ResourceLoader support
Each gadget's CSS is always loaded via the ResourceLoader. However, older JavaScript is often incompatible with RL, so every gadget must be explicitly marked as compatible in order to have its scripts loaded by RL. Otherwise, plain old &lt;script src="/w/index.php?title=MediaWiki:Gadget- gadget_name.js &action=raw&ctype=text/javascript"&gt; will be used.

Every gadget that at least partially uses ResourceLoader (that is, that has styles or compatible scripts) has its own RL module. The modules are named ext.gadget.&lt;gadget name&gt;.

صفحات
The remaining fields on the line refer to the JavaScript or CSS code that makes up the gadget, contained in system messages (MediaWiki:Gadget-mygadget.js and MediaWiki:Gadget-mygadget.css in the example); the names of those messages must end with ".js" or ".css", respectively. A gadget can use any number of code messages, specifically, common code can be put into a code message used by several gadgets, in addition to their own specific code, e.g:

* frobinator|commonStuff.js|frob.js|frob.css|pretty.css * l33t|commonStuff.js|tools.js|l33t.js

Please note that if your code contains strings that could be interpreted as wiki syntax (e.g. the signature code ), you may want to enclose your code into &lt;nowiki&gt; and &lt;/nowiki&gt; and put these tags in JavaScript or CSS comments so they're not interpreted when actually used. See the first and last lines of MediaWiki:Gadget-externalsearch-bar.js for an example.

فقرات
The list of gadgets in MediaWiki:Gadgets-definition can be broken into sections using lines that start and end with two or more "=" (equals) characters, enclosing the name of a system message that defines the section's name - for example:

== interface-gadgets ==

This would define a new section, with the title defined on the page MediaWiki:Gadget-section-interface-gadgets.

قائمة المطلوب عمله

 * Fulfill Basic gadgets

انظر أيضا

 * Extension:Gadgets/Roadmap
 * Gadget Manager
 * Extension:Widgets
 * Snippets