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

Материал из melioration.space
Строка 7: Строка 7:
 
     var surface = ve.init.target.getSurface();
 
     var surface = ve.init.target.getSurface();
 
     //while editing - only on current node
 
     //while editing - only on current node
     surface.on( 'contextChange', function () {
+
     model.on( 'contextChange', function () {
         console.log("Обновление Surface contextChange");
+
         console.log("Обновление model contextChange");
 
//if ( MathJax ) MathJax.typeset();   
 
//if ( MathJax ) MathJax.typeset();   
 
     } );
 
     } );
     view.on( 'documentUpdate', function () {
+
     model.on( 'documentUpdate', function () {
         console.log("Обновление Surface documentUpdate");
+
         console.log("Обновление model documentUpdate");
 
//if ( MathJax ) MathJax.typeset();   
 
//if ( MathJax ) MathJax.typeset();   
 
     } );
 
     } );
 
     model.on( 'ready', function () {
 
     model.on( 'ready', function () {
 +
    console.log("Обновление model ready");
 
         try
 
         try
 
         {
 
         {

Версия 20:12, 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();
    var surface = ve.init.target.getSurface();
    //while editing - only on current node
    model.on( 'contextChange', function () {
        	console.log("Обновление model contextChange");
			//if ( MathJax ) MathJax.typeset();    	
    } );
    model.on( 'documentUpdate', function () {
        	console.log("Обновление model documentUpdate");
			//if ( MathJax ) MathJax.typeset();    	
    } );
    model.on( 'ready', function () {
    	console.log("Обновление model ready");
        try
        {
        	//console.log("Обновление");
			//if ( MathJax ) MathJax.typeset();
        } catch(err){
            console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');
            console.log(err);
        }
    } );
});