mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
Use native URL API, instead of deprecated mw.Uri
Change-Id: Ia6bf82de647eb051f2719c13ceff5a2b07a3721f
This commit is contained in:
parent
f5ebd41ec9
commit
1b5116d668
|
@ -344,7 +344,7 @@
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"ext.echo.api",
|
"ext.echo.api",
|
||||||
"mediawiki.jqueryMsg",
|
"mediawiki.jqueryMsg",
|
||||||
"mediawiki.Uri"
|
"web2017-polyfills"
|
||||||
],
|
],
|
||||||
"messages": [
|
"messages": [
|
||||||
"echo-badge-count",
|
"echo-badge-count",
|
||||||
|
|
|
@ -9,19 +9,13 @@ mw.echo.config.maxPrioritizedActions = 2;
|
||||||
*/
|
*/
|
||||||
function initDesktop() {
|
function initDesktop() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var uri;
|
|
||||||
|
|
||||||
// Remove ?markasread=XYZ from the URL
|
// Remove ?markasread=XYZ from the URL
|
||||||
try {
|
var url = new URL( location.href );
|
||||||
uri = new mw.Uri();
|
if ( url.searchParams.has( 'markasread' ) ) {
|
||||||
if ( uri.query.markasread !== undefined ) {
|
url.searchParams.delete( 'markasread' );
|
||||||
delete uri.query.markasread;
|
url.searchParams.delete( 'markasreadwiki' );
|
||||||
delete uri.query.markasreadwiki;
|
history.replaceState( null, '', url );
|
||||||
window.history.replaceState( null, document.title, uri );
|
|
||||||
}
|
|
||||||
} catch ( e ) {
|
|
||||||
// Catch problems when the URI is malformed (T261799)
|
|
||||||
// e.g. #/media/Fitxer:Campbells_Soup_Cans_MOMA_reduced_80%.jpg
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate ooui
|
// Activate ooui
|
||||||
|
|
Loading…
Reference in a new issue