Vikipedi:Araçlar/Gezinti pencereleri: Revizyonlar arasındaki fark

İçerik silindi İçerik eklendi
150. satır:
More options may be added, and requests for more configurability are welcome.
 
=== AdvancedGelişmiş customizationkişiselleştirme ===
 
==== AddingFiltre filtersekleme ====
 
Maddeler için özel filtre tanımlamanız mümkündür. Bunlar, sayfa istatistikleri oluşturulduktan sonra çalıştırılan javascript fonksiyonlarıdır ve sonuçları (HTML olarak) açılır pencerenin ilgili kısmına eklenmektedir (simplePopups değerinin "true", popupSummaryData değerinin ise "false" olması halinde herhangi bir gösterim olmayacağını unutmayın).
You can define custom filters for articles. These are javascript functions which are run after the page statistics are generated, and their output is appended (as HTML) to that part of the popup. (Note that if simplePopups is true or popupSummaryData is false, then nothing will be displayed).
 
Bunu ayarlamanın yolu, bir betiği (maddenin viki metni) girdi olarak kabul eden ve HTML'nin bir bölümünü getiren bir filtre fonksiyonu yazmaktır. İstediğiniz sayıda filtre için işlemi tekrarlayın ve sonrasında tüm fonksiyonlarını çalışmalarını istediğiniz sıra ile içeren <tt>extraPopupFilters</tt> dizisini oluşturun.
The way to set this up is to write a filter function which accepts a string (the wikitext of the article) as input, and returns a fragment of HTML. Repeat for as many filters as you want, and then create an array <tt>extraPopupFilters</tt> which contains all of the functions, in the order in which you want them to be run.
 
Örneğin, bir maddenin viki işaret dili içerisinde viki kodu yerine HTML etiketleri kullanılarak yazılmış bir tablo bulunduğu zaman bundan haberdar olmak istediğinizi düşünelim. Bunun yollarından biri, aşağıdaki kodu javascript dosyanıza eklemektir:
For example, let's say you want to be told whenever the wikitext of an article contains a table written using HTML tags rather than wiki markup. One way to do this is to add the following to your user javascript file:
 
<source lang=javascript>
// diziyi sadece bir kez olmak üzere başlat
// initialize the array - only do this once
extraPopupFilters=[];
 
// fonksiyonu tanımla
// define the function
function popupFilterHtmlTable (wikiText) {
if (/<table/i.test(wikiText)) return '&lt;table&gt;';
170. satır:
};
 
// fonksiyonu diziye ekle (bunu birçok fonksiyon için tekrar edebilirsiniz)
// add the function to the array (you can repeat this for lots of functions)
extraPopupFilters.push(popupFilterHtmlTable);
</source>
 
Bu durumda HTML tablosu içeren bir sayfa için açılır pencere oluşturulduğunda, pencerede &lt;table&gt; ibaresini göreceksiniz (Bu sayfa gibi diğer sayfalarda da çıkması mümkündür. Bu kusurun düzeltilmesini okuyucu için bir alıştırma konusu olarak bırakıyoruz).
Then when a popup is generated for a page containing an HTML table, you should see &lt;table&gt; in the popup. (It may also appear for other pages, such as this page. Correcting this defect is left as an exercise for the reader).
 
==== Diğer örnekler ====