Skip to content

Commit

Permalink
Update jquery.ui dependency for compatibility with MW >= 1.35
Browse files Browse the repository at this point in the history
Because 1.31 is LTS we also need to keep supporting that for now,
hence the test for which version we are running.

Fixes #37
  • Loading branch information
thijskh committed Apr 12, 2021
1 parent 76ec239 commit 0090322
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 0090322

Please sign in to comment.