MediaWiki:Common.js: verschil tussen versies

Uit Auditpedia
Ga naar:navigatie, zoeken
Regel 17: Regel 17:
 
if ( vetextarea ) {
 
if ( vetextarea ) {
 
     //load veforall
 
     //load veforall
     new mw.Api().loadMessagesIfMissing( ['visualeditor-toolbar-cite'] );
+
     new mw.Api().loadMessagesIfMissing( ['ve-cite'] );
 
     mw.loader.using( ['ext.veforall.main','ext.cite.visualEditor',''] ).then(function(data){
 
     mw.loader.using( ['ext.veforall.main','ext.cite.visualEditor',''] ).then(function(data){
 
       console.log("VE modules loaded!");
 
       console.log("VE modules loaded!");
 
     });
 
     });
 
  }
 
  }

Versie van 5 apr 2022 15:32

/* Any JavaScript here will be loaded for all users on every page load. <script>*/

// take every link-captioned image and change the link to the link in the caption, if present
$( document ).ready(function() {
  $('#mw-content-text div.thumb a.image').each(function() {
    var link = $(this).closest('.thumb').find('div.thumbcaption a');
    if (link.length ) {
      var url = link[link.length-1].href;
      this.href = url;
    };
  });
});

//check for visualeditor textareas

var vetextarea = document.querySelector('.ve-area-wrapper');
if ( vetextarea ) {
     //load veforall
     new mw.Api().loadMessagesIfMissing( ['ve-cite'] );
     mw.loader.using( ['ext.veforall.main','ext.cite.visualEditor',''] ).then(function(data){
       console.log("VE modules loaded!");
    });
 }