Skip to content

Commit

Permalink
Merge pull request #40 from thijskh/bugfix/jquery-compat-mw-1.35
Browse files Browse the repository at this point in the history
Update jquery.ui dependency for compatibility with MW >= 1.35
  • Loading branch information
JeroenDeDauw committed Apr 12, 2021
2 parents 76ec239 + 0090322 commit 4a45e15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/SimpleBatchUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public function registerParserFunction( &$parser ) {
}

protected function getUploadSupportModuleDefinition(): array {
if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.35.0', '>' ) ) {
$dependencies = [ 'jquery.ui' ];
} else {
$dependencies = [ 'jquery.ui.widget' ];
}

return [ 'ext.SimpleBatchUpload.jquery-file-upload' =>

$this->getBasePathsForNonComposerModules() +
Expand All @@ -105,7 +111,7 @@ protected function getUploadSupportModuleDefinition(): array {
'scripts' => [ 'res/jquery.fileupload.js' ],
'styles' => [ 'res/jquery.fileupload.css' ],
'position' => 'top',
'dependencies' => [ 'jquery.ui.widget' ],
'dependencies' => $dependencies,
],
];
}
Expand Down

0 comments on commit 4a45e15

Please sign in to comment.