MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
} | } | ||
*/ | */ | ||
var ul = document.querySelector(.ns-3000 #p-namespaces ul,.ns-3001 #p-namespaces ul");//finding the list | |||
var newLi = document.createElement("li");// creating a list item | |||
newLi.innerHTML = '<span><a href="#" title="[insert title]">ciao</a></span>'; | |||
if (ul){ | |||
ul.appendChild(newLi);//adding list item to list | |||
} |
Revision as of 19:49, 5 October 2021
/* Any JavaScript here will be loaded for all users on every page load. */ /* var customizeToolbar = function () { console.log('ciao'); }; if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { mw.loader.using( 'user.options' ).then( function () { if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) { $.when( mw.loader.using( 'ext.wikiEditor' ), $.ready ).then( customizeToolbar ); } } ); } */ var ul = document.querySelector(.ns-3000 #p-namespaces ul,.ns-3001 #p-namespaces ul");//finding the list var newLi = document.createElement("li");// creating a list item newLi.innerHTML = '<span><a href="#" title="[insert title]">ciao</a></span>'; if (ul){ ul.appendChild(newLi);//adding list item to list }