MediaWiki:Common.js — различия между версиями
Материал Psylab.info - энциклопедии психодиагностики
м |
м |
||
| Строка 1: | Строка 1: | ||
| + | /* Дополнительные кнопки в WikiEditor */ | ||
| + | |||
| + | jQuery(document).ready(function ($) { | ||
| + | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
| + | section: 'advanced', | ||
| + | group: 'format', | ||
| + | tools: { | ||
| + | "math": { | ||
| + | label: 'Math', | ||
| + | type: 'button', | ||
| + | icon: '//bits.wikimedia.org/skins-1.5/common/images/button_math.png', | ||
| + | action: { | ||
| + | type: 'encapsulate', | ||
| + | options: { | ||
| + | pre: "<math>", | ||
| + | post: "</math>" | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | }); | ||
| + | }); | ||
| + | |||
| + | |||
/* Подсветка синтаксиса при помощи highlight.js */ | /* Подсветка синтаксиса при помощи highlight.js */ | ||
Версия 12:47, 17 февраля 2014
/* Дополнительные кнопки в WikiEditor */
jQuery(document).ready(function ($) {
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"math": {
label: 'Math',
type: 'button',
icon: '//bits.wikimedia.org/skins-1.5/common/images/button_math.png',
action: {
type: 'encapsulate',
options: {
pre: "<math>",
post: "</math>"
}
}
}
}
});
});
/* Подсветка синтаксиса при помощи highlight.js */
/*
mw.loader.load( 'http://yandex.st/highlightjs/8.0/highlight.min.js', 'text/javascript' );
mw.loader.load( 'http://yandex.st/highlightjs/8.0/languages/r.min.js', 'text/javascript' );
mw.loader.load( 'http://yandex.st/highlightjs/8.0/styles/idea.min.css', 'text/css' );
window.onload = function() {
var aCodes = document.getElementsByTagName('pre');
for (var i=0; i < aCodes.length; i++) {
hljs.highlightBlock(aCodes[i]);
}
};
(function($) {
$(document).ready(function() {
$('pre').each(function(i, e) {
hljs.highlightBlock(e)
});
});
}(jQuery));
//hljs.configure({tabReplace: ' '});
hljs.initHighlightingOnLoad();
*/