MediaWiki:Common.js: различия между версиями
Материал из melioration.space
Sonys (обсуждение | вклад) |
Sonys (обсуждение | вклад) |
||
| Строка 1: | Строка 1: | ||
mw.hook( 've.activationComplete' ).add( function() { | mw.hook( 've.activationComplete' ).add( function() { | ||
console.log("Назначение"); | console.log("Назначение"); | ||
| − | MathJax.typeset(); | + | if ( MathJax ) MathJax.typeset(); |
var view =ve.init.target.getSurface().getView(); | var view =ve.init.target.getSurface().getView(); | ||
var doc = view.getDocument(); | var doc = view.getDocument(); | ||
var model = ve.init.target.getSurface().getModel(); | var model = ve.init.target.getSurface().getModel(); | ||
//while editing - only on current node | //while editing - only on current node | ||
| − | model.on( ' | + | model.on( 'documentReady', function () { |
| − | |||
try | try | ||
{ | { | ||
| − | MathJax.typeset(); | + | console.log("Обновление"); |
| + | if ( MathJax ) MathJax.typeset(); | ||
} catch(err){ | } catch(err){ | ||
console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate'); | console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate'); | ||
Версия 19:31, 25 декабря 2020
mw.hook( 've.activationComplete' ).add( function() {
console.log("Назначение");
if ( MathJax ) MathJax.typeset();
var view =ve.init.target.getSurface().getView();
var doc = view.getDocument();
var model = ve.init.target.getSurface().getModel();
//while editing - only on current node
model.on( 'documentReady', function () {
try
{
console.log("Обновление");
if ( MathJax ) MathJax.typeset();
} catch(err){
console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');
console.log(err);
}
} );
});