dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve 1-letter variable names in MutableContext and implementations"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.action
/
mediawiki.action.edit.preview.js
diff --git
a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js
b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js
index
ab1ce27
..
b87fba7
100644
(file)
--- a/
resources/src/mediawiki.action/mediawiki.action.edit.preview.js
+++ b/
resources/src/mediawiki.action/mediawiki.action.edit.preview.js
@@
-99,7
+99,8
@@
rvdifftotext: $textbox.textSelection( 'getContents' ),
rvdifftotextpst: true,
rvprop: '',
rvdifftotext: $textbox.textSelection( 'getContents' ),
rvdifftotextpst: true,
rvprop: '',
- rvsection: section === '' ? undefined : section
+ rvsection: section === '' ? undefined : section,
+ uselang: mw.config.get( 'wgUserLanguage' )
} );
// Wait for the summary before showing the diff so the page doesn't jump twice
} );
// Wait for the summary before showing the diff so the page doesn't jump twice
@@
-136,7
+137,7
@@
parseRequest = api.post( postData );
parseRequest.done( function ( response ) {
parseRequest = api.post( postData );
parseRequest.done( function ( response ) {
- var
li,
newList, $displaytitle, $content, $parent, $list;
+ var newList, $displaytitle, $content, $parent, $list;
if ( response.parse.jsconfigvars ) {
mw.config.set( response.parse.jsconfigvars );
}
if ( response.parse.jsconfigvars ) {
mw.config.set( response.parse.jsconfigvars );
}
@@
-182,9
+183,8
@@
$( '.catlinks[data-mw="interface"]' ).replaceWith( $content );
}
if ( response.parse.templates ) {
$( '.catlinks[data-mw="interface"]' ).replaceWith( $content );
}
if ( response.parse.templates ) {
- newList = [];
- $.each( response.parse.templates, function ( i, template ) {
- li = $( '<li>' )
+ newList = response.parse.templates.map( function ( template ) {
+ return $( '<li>' )
.append( $( '<a>' )
.attr( {
href: mw.util.getUrl( template.title ),
.append( $( '<a>' )
.attr( {
href: mw.util.getUrl( template.title ),
@@
-192,7
+192,6
@@
} )
.text( template.title )
);
} )
.text( template.title )
);
- newList.push( li );
} );
$editform.find( '.templatesUsed .mw-editfooter-list' ).detach().empty().append( newList ).appendTo( '.templatesUsed' );
} );
$editform.find( '.templatesUsed .mw-editfooter-list' ).detach().empty().append( newList ).appendTo( '.templatesUsed' );
@@
-201,10
+200,9
@@
$( '.limitreport' ).html( response.parse.limitreporthtml );
}
if ( response.parse.langlinks && mw.config.get( 'skin' ) === 'vector' ) {
$( '.limitreport' ).html( response.parse.limitreporthtml );
}
if ( response.parse.langlinks && mw.config.get( 'skin' ) === 'vector' ) {
- newList = [];
- $.each( response.parse.langlinks, function ( i, langlink ) {
+ newList = response.parse.langlinks.map( function ( langlink ) {
var bcp47 = mw.language.bcp47( langlink.lang );
var bcp47 = mw.language.bcp47( langlink.lang );
-
li =
$( '<li>' )
+
return
$( '<li>' )
.addClass( 'interlanguage-link interwiki-' + langlink.lang )
.append( $( '<a>' )
.attr( {
.addClass( 'interlanguage-link interwiki-' + langlink.lang )
.append( $( '<a>' )
.attr( {
@@
-215,7
+213,6
@@
} )
.text( langlink.autonym )
);
} )
.text( langlink.autonym )
);
- newList.push( li );
} );
$list = $( '#p-lang ul' );
$parent = $list.parent();
} );
$list = $( '#p-lang ul' );
$parent = $list.parent();