jenkins-bot has submitted this change and it was merged. Change subject: Make autocompletion work on Special:PagePrepation ......................................................................
Make autocompletion work on Special:PagePrepation Change-Id: I208d516cb78c723f5f55468bcb41a422834b20e6 --- M resources/js/ext.translate.special.pagepreparation.js M specials/SpecialPagePreparation.php 2 files changed, 10 insertions(+), 8 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.translate.special.pagepreparation.js b/resources/js/ext.translate.special.pagepreparation.js index 9f77222..c3d0286 100644 --- a/resources/js/ext.translate.special.pagepreparation.js +++ b/resources/js/ext.translate.special.pagepreparation.js @@ -287,7 +287,8 @@ } $( document ).ready( function () { - var pageContent; + var pageContent, + $input = $( '#page' ); $( '#action-cancel' ).click( function () { document.location.reload( true ); @@ -295,14 +296,14 @@ $( '#action-save' ).click( function () { var serverName, pageUrl = '', pageName; - pageName = $.trim( $( '#title' ).val() ); + pageName = $.trim( $input.val() ); serverName = mw.config.get( 'wgServerName' ); savePage( pageName, pageContent ).done( function () { pageUrl = mw.Title.newFromText( pageName ).getUrl( { action: 'edit' } ); $( '.messageDiv' ).html( mw.message( 'pp-save-message', pageUrl ).parse() ).show(); $( '.divDiff' ).hide( 'fast' ); $( '#action-prepare' ).show(); - $( '#title' ).val( '' ); + $input.val( '' ); $( '#action-save' ).hide(); $( '#action-cancel' ).hide(); } ); @@ -310,7 +311,7 @@ $( '#action-prepare' ).click( function () { var pageName, messageDiv = $( '.messageDiv' ); - pageName = $.trim( $( '#title' ).val() ); + pageName = $.trim( $input.val() ); messageDiv.hide(); if ( pageName === '' ) { window.alert( mw.msg( 'pp-pagename-missing' ) ); diff --git a/specials/SpecialPagePreparation.php b/specials/SpecialPagePreparation.php index a4674d8..aa91cc9 100644 --- a/specials/SpecialPagePreparation.php +++ b/specials/SpecialPagePreparation.php @@ -18,6 +18,8 @@ $output = $this->getOutput(); $this->setHeaders(); $this->checkPermissions(); + + $inputValue = htmlspecialchars( $request->getText( 'page', $par ) ); $pagenamePlaceholder = $this->msg( 'pp-pagename-placeholder' )->escaped(); $prepareButtonValue = $this->msg( 'pp-prepare-button-label' )->escaped(); $saveButtonValue = $this->msg( 'pp-save-button-label' )->escaped(); @@ -25,7 +27,6 @@ $summaryValue = $this->msg( 'pp-save-summary' )->inContentLanguage()->escaped(); $output->addModules( 'ext.translate.special.pagepreparation' ); $output->addModuleStyles( 'jquery.uls.grid' ); - $param = $request->getText( 'param' ); $out = ''; $diff = new DifferenceEngine( $this->getContext() ); @@ -34,10 +35,10 @@ $out = <<<HTML <div class="grid"> - <form class="mw-tpp-sp-form row" name="mw-tpp-sp-input-form"> + <form class="mw-tpp-sp-form row" name="mw-tpp-sp-input-form" action=""> <input id="pp-summary" type="hidden" value="{$summaryValue}" /> - <input name="title" id="title" class="mw-searchInput mw-ui-input" - placeholder="{$pagenamePlaceholder}" /> + <input name="page" id="page" class="mw-searchInput mw-ui-input" + placeholder="{$pagenamePlaceholder}" value="{$inputValue}"/> <button id="action-prepare" class="mw-ui-button mw-ui-primary" type="button"> {$prepareButtonValue}</button> <button id="action-save" class="mw-ui-button mw-ui-constructive hide" type="button"> -- To view, visit https://gerrit.wikimedia.org/r/203389 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I208d516cb78c723f5f55468bcb41a422834b20e6 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits