DiscussionTemplates, kullanıcıların kendi seçtikleri bir şablonla duvar mesajı göndermelerine olanak tanır. Bu betik için düğme, yeni bir mesaj duvarı konuşması oluştururken düzenleyicideki gönder düğmesinin yanında bulunabilir. Tartışmalar vb. nasıl tasarlandığına bağlı olarak, yalnızca temel vikimetnin çalıştığını ve arka planlar gibi şeylerin çalışmayacağını unutmayın.
Installation
Usage
Yapılandırma seçenekleri şunlardır:
templates: İçinde şablon listenizin bulunduğu nesne (anahtar etikettir, değer, şablon adı (ad alanı dahil) olannameiçeren bir nesnedir vetitle, mesajın başlığıdır)wikiList:'key': 'https://community.fandom.com/fr'biçimini kullanarak$WIKIile (yer tutucu şablonunuzdadır) değiştirmek için seçilecek vikilerin listesi, yer tutucu kullanmıyorsanız bu gerekli değildirallowedGroups, isteğe bağlı bir dizidir ve tanımlanmışsa, komut dosyasının çalıştırılmasını yalnızca listelenen kullanıcı gruplarındaki kullanıcılarla kısıtlar.
$USER da desteklenir ve bulunduğu duvardaki kullanıcının kullanıcı adıyla değiştirilir.
Örneğin:
window.DiscussionTemplates = {
templates: {
'item-1': {
name: 'Template:Item 1',
title: 'Title 1'
},
'item-2': {
name: 'Template:Item-2',
title: 'This is title 2'
},
item3: {
name: 'Template:Name3',
title: 'Title2'
}
},
wikiList: {
de: 'https://example.fandom.com/de',
es: 'https://example-es.fandom.com',
fi: 'https://example.fandom.com/fi'
},
allowedGroups: ['sysop', 'rollback']
};
Using configuration options with Fandom Developers Wiki scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.
Configuration options load too late, don't work
// 1. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 2. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});