Amire80 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144658

Change subject: Go to the translated page immediately after publishing
......................................................................

Go to the translated page immediately after publishing

The bubble notification about publishing is not needed
anymore, so it's removed along with the message it shows.

The publish button is restored to be active only if
the publishing fails.

Change-Id: I07b56d3c5287a987c96e3a74d7abf19fd7efb5ea
---
M Resources.php
M i18n/en.json
M modules/translation/ext.cx.publish.js
3 files changed, 7 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/58/144658/1

diff --git a/Resources.php b/Resources.php
index 8806a15..d303b45 100644
--- a/Resources.php
+++ b/Resources.php
@@ -238,7 +238,6 @@
                'mediawiki.cookie',
        ),
        'messages' => array(
-               'cx-publish-page',
                'cx-publish-page-error',
                'cx-publish-button-publishing',
        ),
diff --git a/i18n/en.json b/i18n/en.json
index 0514b99..92311a2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,7 +13,6 @@
        "cx-header-progressbar-text": "$1% translated",
        "cx-header-translation-center": "Translation center",
        "cx-source-view-page": "view page",
-       "cx-publish-page": "Page published at [$1 $2]",
        "cx-publish-page-error": "Error while saving page.",
        "cx-publish-button": "Publish translation",
        "cx-publish-button-publishing": "Publishing...",
diff --git a/modules/translation/ext.cx.publish.js 
b/modules/translation/ext.cx.publish.js
index dbf7d92..436e51a 100644
--- a/modules/translation/ext.cx.publish.js
+++ b/modules/translation/ext.cx.publish.js
@@ -34,7 +34,7 @@
        }
 
        mw.cx.publish = function () {
-               var translatedTitle, translatedContent, $publishButton;
+               var translatedTitle, draftTitle, translatedContent, 
$publishButton;
 
                $publishButton = $( '.cx-header__publish' );
                $publishButton
@@ -47,19 +47,19 @@
                initGuidedTour( translatedTitle );
 
                // To be saved under User:UserName
-               translatedTitle = 'User:' + mw.user.getName() + '/' + 
translatedTitle;
-               publishTranslation( translatedTitle, translatedContent, 
mw.cx.sourceTitle )
+               draftTitle = 'User:' + mw.user.getName() + '/' + 
translatedTitle;
+               publishTranslation( draftTitle, translatedContent, 
mw.cx.sourceTitle )
                        .done( function () {
-                               mw.notify( $( '<p>' ).html( mw.message( 
'cx-publish-page',
-                                       mw.util.getUrl( translatedTitle ), 
translatedTitle ).parse() ) );
-
                                mw.hook( 'mw.cx.translate.create' ).fire(
                                        mw.cx.sourceLanguage,
                                        mw.cx.targetLanguage
                                );
+
+                               // Open the newly-created page
+                               window.location.href = mw.util.getUrl( 
draftTitle );
                        } ).fail( function () {
                                mw.notify( mw.msg( 'cx-publish-page-error' ) );
-                       } ).always( function () {
+
                                $publishButton.prop( 'disabled', false )
                                        .text( mw.msg( 'cx-publish-button' ) );
                        } );

-- 
To view, visit https://gerrit.wikimedia.org/r/144658
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07b56d3c5287a987c96e3a74d7abf19fd7efb5ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to