MediaWiki:Common.js/edit.js: Difference between revisions

do we need mediawiki.util and the .then syntax?
(how about here?)
(do we need mediawiki.util and the .then syntax?)
Line 127: Line 127:
}
}


         mw.loader.using( 'user.options', function () {
         mw.loader.using('user.options').then(function () {
if ( mw.user.options.get('usebetatoolbar') ) {
if ( mw.user.options.get('usebetatoolbar') ) {
// Use the enhanced edit toolbar
// Use the enhanced edit toolbar
mw.loader.using( 'ext.wikiEditor.toolbar', function () {
mw.loader.using('ext.wikiEditor.toolbar').then(function () {
$(function(){
$(function(){
// Build the new buttons
// Build the new buttons
Line 176: Line 176:
} else {
} else {
  alert("Using classic toolbar.");
  alert("Using classic toolbar.");
                   mw.loader.using( 'mw.toolbar', function () {
                   mw.loader.using( ['mediawiki.util', 'mw.toolbar']).then(function () {
                     $(function(){
                     $(function(){
// Use the old edit toolbar
// Use the old edit toolbar