MediaWiki:Common.js: различия между версиями

Материал из melioration.space
Строка 1: Строка 1:
 
mw.hook( 've.activationComplete' ).add( function() {
 
mw.hook( 've.activationComplete' ).add( function() {
 
console.log("Назначение");
 
console.log("Назначение");
if ( MathJax ) MathJax.typeset();
+
UpdateJax();
    var view =ve.init.target.getSurface().getView();
+
var view =ve.init.target.getSurface().getView();
    var model = ve.init.target.getSurface().getModel();
+
var model = ve.init.target.getSurface().getModel();
    var surface = ve.init.target.getSurface();
 
  
     function UpdateJax( obb ) {
+
     function UpdateJax() {
    console.log('333');
+
     if ( MathJax ) MathJax.typeset();
     if ( MathJax ) MathJax.typeset(obb);
 
 
     return true;
 
     return true;
 
     }
 
     }
 
      
 
      
ve.ce.GeneratedContentNode.bind('renderer', UpdateJax);
+
//ve.ce.GeneratedContentNode.bind('renderer', UpdateJax);
 
     //ve.trackSubscribeAll(test2);
 
     //ve.trackSubscribeAll(test2);
 
//ve.trackSubscribe('activity.chem',test3);
 
//ve.trackSubscribe('activity.chem',test3);

Версия 22:58, 25 декабря 2020

mw.hook( 've.activationComplete' ).add( function() {
	console.log("Назначение");
	UpdateJax();
	var view =ve.init.target.getSurface().getView();
	var model = ve.init.target.getSurface().getModel();

    function UpdateJax() {
    	if ( MathJax ) MathJax.typeset();
    	return true;
    }
    
	//ve.ce.GeneratedContentNode.bind('renderer', UpdateJax);
    //ve.trackSubscribeAll(test2);
	//ve.trackSubscribe('activity.chem',test3);
	//ve.trackSubscribe('activity.chem',test3);

    model.on( 'contextChange', function () {
        try
        {
        	//console.log("Обновление");
        	//setTimeout(MathJax.typeset, 500);
			//setTimeout(test3, 200);
        } catch(err){
            console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');
            console.log(err);
        }
    } );
});