Santhosh has uploaded a new change for review.

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

Change subject: Simplify the UI construction code, remove progress bar
......................................................................

Simplify the UI construction code, remove progress bar

Progress bar will re-appear in tools column soon

Change-Id: I6f7bdc9cefda505c7da41d201cc7d57b7e57c164
---
M modules/header/ext.cx.header.render.js
R modules/tools/ext.cx.progressbar.js
R modules/tools/styles/ext.cx.progressbar.less
3 files changed, 25 insertions(+), 32 deletions(-)


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

diff --git a/modules/header/ext.cx.header.render.js 
b/modules/header/ext.cx.header.render.js
index df76cc4..2328bae 100644
--- a/modules/header/ext.cx.header.render.js
+++ b/modules/header/ext.cx.header.render.js
@@ -12,39 +12,32 @@
        'use strict';
 
        mw.cx.ContentTranslationHeader.prototype.render = function () {
-               this.$container.addClass( 'cx-header' );
-               this.$container.append(
-                       $( '<div>' )
-                               .addClass( 'cx-header__logo' ),
-                       $( '<div>' )
-                               .addClass( 'cx-header__user-details' )
-                               .append(
-                                       $( '<a>' )
-                                               .addClass( 
'cx-header__user-details__user-name' )
-                                               .attr( 'href', mw.util.getUrl( 
'User:' + mw.user.getName() ) )
-                                               .text( mw.user.getName() )
-                               )
-               );
+               var $logo, $userName, $userDetails, $headerBar, $publishButton,
+                       $translationCenterLink, $translationCenter;
 
-               this.$container.append(
-                       $( '<div>' )
-                               .addClass( 'cx-header__bar' )
-                               .append(
-                                       $( '<div>' )
-                                               .addClass( 
'cx-header__translation-center' )
-                                               .append(
-                                                       $( '<a>' )
-                                                               .text( mw.msg( 
'cx-header-translation-center' ) )
-                                                               .attr( 'href', 
'#' )
-                                               ),
-                                       $( '<div>' )
-                                               .addClass( 
'cx-header__progressbar' )
-                                               .cxProgressBar(),
-                                       $( '<button>' )
-                                               .addClass( 'cx-header__publish 
publish mw-ui-button mw-ui-constructive' )
-                                               .text( mw.msg( 
'cx-publish-button' ) )
-                               )
-               );
+               $logo = $( '<div>' ).addClass( 'cx-header__logo' );
+               $userName = $( '<a>' )
+                       .addClass( 'cx-header__user-details__user-name' )
+                       .attr( 'href', mw.util.getUrl( 'User:' + 
mw.user.getName() ) )
+                       .text( mw.user.getName() );
+               $userDetails = $( '<div>' )
+                       .addClass( 'cx-header__user-details' )
+                       .append( $userName );
+               $publishButton = $( '<button>' )
+                       .addClass( 'cx-header__publish publish mw-ui-button 
mw-ui-constructive' )
+                       .text( mw.msg( 'cx-publish-button' ) );
+               $translationCenterLink = $( '<a>' )
+                       .text( mw.msg( 'cx-header-translation-center' ) )
+                       .attr( 'href', '#' );
+               $translationCenter = $( '<div>' )
+                       .addClass( 'cx-header__translation-center' )
+                       .append( $translationCenterLink );
+               $headerBar = $( '<div>' )
+                       .addClass( 'cx-header__bar' )
+                       .append( $translationCenter, $publishButton );
+               this.$container
+                       .addClass( 'cx-header' )
+                       .append( $logo, $userDetails, $headerBar );
        };
 
 }( jQuery, mediaWiki ) );
diff --git a/modules/header/ext.cx.progressbar.js 
b/modules/tools/ext.cx.progressbar.js
similarity index 100%
rename from modules/header/ext.cx.progressbar.js
rename to modules/tools/ext.cx.progressbar.js
diff --git a/modules/header/styles/ext.cx.progressbar.less 
b/modules/tools/styles/ext.cx.progressbar.less
similarity index 100%
rename from modules/header/styles/ext.cx.progressbar.less
rename to modules/tools/styles/ext.cx.progressbar.less

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f7bdc9cefda505c7da41d201cc7d57b7e57c164
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

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

Reply via email to