MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
Claustrum (обсуждение | вклад) Нет описания правки |
Claustrum (обсуждение | вклад) мНет описания правки |
||
Строка 3: | Строка 3: | ||
// Примечания в цитатах | // Примечания в цитатах | ||
// | // | ||
$('blockquote.quote sup.reference a').each (function () { | $('blockquote.quote sup.reference a').each (function () { | ||
var match = $(this).text ().match (/\[([^\[\]]*)\s([\d]+)\]/); | var match = $(this).text ().match (/\[([^\[\]]*)\s([\d]+)\]/); | ||
if (match !== null) | if (match !== null) { | ||
$(this). | $(this).text ('[' + match[2] + ']'); | ||
$(this).parent ().addClass ('localCiteRef'); | |||
} | |||
}); | }); | ||
Версия от 20:13, 5 марта 2013
// // Примечания в цитатах // $('blockquote.quote sup.reference a').each (function () { var match = $(this).text ().match (/\[([^\[\]]*)\s([\d]+)\]/); if (match !== null) { $(this).text ('[' + match[2] + ']'); $(this).parent ().addClass ('localCiteRef'); } }); // // WikiEditor // mw.loader.using('user.options',function(){if (mw.user.options.get('usebetatoolbar')){mw.loader.using('ext.wikiEditor.toolbar',function(){$(document).ready(function(){ $('#wpTextbox1').wikiEditor ('addToToolbar', { 'sections': { 'templates': { 'type': 'toolbar', 'label': 'Шаблоны' } } }); $('#wpTextbox1').wikiEditor ('addToToolbar', { 'section': 'templates', 'groups': { 'refs': { 'label': 'Источники' }, 'other': { 'label': 'Прочее' } } }); $('#wpTextbox1').wikiEditor ('addToToolbar', { 'section': 'templates', 'group': 'refs', 'tools': { 'quran': { label: 'Коран', type: 'button', icon: '/wiki/images/c/ce/WE-Quran-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Коран|', peri: 'сура|аят', post: '}}' } } }, 'bukhari': { label: 'Сахих аль-Бухари', type: 'button', icon: '/wiki/images/2/21/WE-Bukhari-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Бухари|', peri: 'том|книга|номер', post: '}}' } } }, 'muslim': { label: 'Сахих Муслима', type: 'button', icon: '/wiki/images/a/ac/WE-Muslim-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Муслим|', peri: 'книга|номер', post: '}}' } } }, 'tabari': { label: 'Ат-Табари', type: 'button', icon: '/wiki/images/6/67/WE-Tabari-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Табари|', peri: 'том|страница', post: '}}' } } }, 'abudawud': { label: 'Абу Дауд', type: 'button', icon: '/wiki/images/5/52/WE-AbuDawud-Icon.png', action: { type: 'encapsulate', options: { pre: '{{АбуДауд|', peri: 'книга|номер', post: '}}' } } }, 'muwatta': { label: 'Аль-Муватта', type: 'button', icon: '/wiki/images/5/5a/WE-Muwatta-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Муватта|', peri: 'книга|секция|номер|', post: '}}' } } } } }); $('#wpTextbox1').wikiEditor ('addToToolbar', { 'section': 'templates', 'group': 'other', 'tools': { 'quote': { label: 'Цитата', type: 'button', icon: '/wiki/images/f/fa/WE-Quote-Icon.png', action: { type: 'encapsulate', options: { pre: '{{Цитата|', peri: 'текст цитаты|источник цитаты', post: '}}' } } } } }); });});}});