mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Merge "Use .textSelection( 'getContents' ) instead of .val() to get the value of #wpTextbox1"
This commit is contained in:
commit
aac64e6068
|
@ -550,8 +550,7 @@
|
|||
},
|
||||
|
||||
activateVe: function () {
|
||||
var wikitext = $( '#wpTextbox1' ).val(),
|
||||
wikitextModified = wikitext !== initialWikitext;
|
||||
var wikitext = $( '#wpTextbox1' ).textSelection( 'getContents' );
|
||||
|
||||
// Close any open jQuery.UI dialogs (e.g. WikiEditor's find and replace)
|
||||
if ( $.fn.dialog ) {
|
||||
|
@ -560,7 +559,10 @@
|
|||
|
||||
if (
|
||||
mw.config.get( 'wgAction' ) === 'submit' ||
|
||||
( mw.config.get( 'wgAction' ) === 'edit' && wikitextModified ) ||
|
||||
(
|
||||
mw.config.get( 'wgAction' ) === 'edit' &&
|
||||
wikitext !== initialWikitext
|
||||
) ||
|
||||
// switching from section editing must prompt because we can't
|
||||
// keep changes from that (yet?)
|
||||
$( 'input[name=wpSection]' ).val()
|
||||
|
@ -718,7 +720,7 @@
|
|||
urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( location.href ).query;
|
||||
|
||||
if ( uri.query.action === 'edit' && $( '#wpTextbox1' ).length ) {
|
||||
initialWikitext = $( '#wpTextbox1' ).val();
|
||||
initialWikitext = $( '#wpTextbox1' ).textSelection( 'getContents' );
|
||||
}
|
||||
|
||||
if ( init.isAvailable ) {
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
ve.track( 'trace.restbaseLoad.enter' );
|
||||
if (
|
||||
conf.fullRestbaseUrl &&
|
||||
$( '#wpTextbox1' ).val() &&
|
||||
$( '#wpTextbox1' ).textSelection( 'getContents' ) &&
|
||||
!$( '[name=wpSection]' ).val()
|
||||
) {
|
||||
switched = true;
|
||||
|
@ -153,7 +153,7 @@
|
|||
data: {
|
||||
title: pageName,
|
||||
oldid: oldid,
|
||||
wikitext: $( '#wpTextbox1' ).val(),
|
||||
wikitext: $( '#wpTextbox1' ).textSelection( 'getContents' ),
|
||||
stash: 'true'
|
||||
},
|
||||
// Should be synchronised with ApiVisualEditor.php
|
||||
|
|
Loading…
Reference in a new issue