Merge "Use new OOUI pending feature rather than loading bar thing on save dialog"

This commit is contained in:
jenkins-bot 2014-04-18 21:20:51 +00:00 committed by Gerrit Code Review
commit fd0b1d34b9
4 changed files with 11 additions and 25 deletions

View file

@ -121,8 +121,7 @@
/* Images */
.ve-init-mw-viewPageTarget-loading,
.ve-ui-mwSaveDialog-working {
.ve-init-mw-viewPageTarget-loading {
/* @embed */
background-image: url(images/loading-ltr.gif);
}

View file

@ -442,7 +442,7 @@ ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, ne
*/
ve.init.mw.ViewPageTarget.prototype.onSaveAsyncBegin = function () {
this.saveDialog.saveButton.setDisabled( true );
this.saveDialog.$loadingIcon.show();
this.saveDialog.pushPending();
};
/**
@ -452,7 +452,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveAsyncBegin = function () {
*/
ve.init.mw.ViewPageTarget.prototype.onSaveAsyncComplete = function () {
this.saveDialog.saveButton.setDisabled( false );
this.saveDialog.$loadingIcon.hide();
this.saveDialog.popPending();
};
/**
@ -613,7 +613,7 @@ ve.init.mw.ViewPageTarget.prototype.onShowChanges = function ( diffHtml ) {
*/
ve.init.mw.ViewPageTarget.prototype.onShowChangesError = function ( jqXHR, status ) {
alert( ve.msg( 'visualeditor-differror', status ) );
this.saveDialog.$loadingIcon.hide();
this.saveDialog.popPending();
};
/**
@ -629,7 +629,7 @@ ve.init.mw.ViewPageTarget.prototype.onSerializeError = function ( jqXHR, status
// It's possible to get here while the save dialog has never been opened (if the user uses
// the switch to source mode option)
if ( this.saveDialog ) {
this.saveDialog.$loadingIcon.hide();
this.saveDialog.popPending();
}
};
@ -639,7 +639,7 @@ ve.init.mw.ViewPageTarget.prototype.onSerializeError = function ( jqXHR, status
* @method
*/
ve.init.mw.ViewPageTarget.prototype.onEditConflict = function () {
this.saveDialog.$loadingIcon.hide();
this.saveDialog.popPending();
this.saveDialog.swapPanel( 'conflict' );
};
@ -649,7 +649,7 @@ ve.init.mw.ViewPageTarget.prototype.onEditConflict = function () {
* @method
*/
ve.init.mw.ViewPageTarget.prototype.onNoChanges = function () {
this.saveDialog.$loadingIcon.hide();
this.saveDialog.popPending();
this.saveDialog.swapPanel( 'nochanges' );
this.saveDialog.reviewGoodButton.setDisabled( false );
};
@ -775,7 +775,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveDialogReview = function () {
if ( !this.saveDialog.$reviewViewer.find( 'table, pre' ).length ) {
this.emit( 'saveReview' );
this.saveDialog.reviewGoodButton.setDisabled( true );
this.saveDialog.$loadingIcon.show();
this.saveDialog.pushPending();
if ( this.pageExists ) {
// Has no callback, handled via target.onShowChanges
this.showChanges( this.docToSave );
@ -828,7 +828,7 @@ ve.init.mw.ViewPageTarget.prototype.saveDocument = function () {
);
} else {
this.saveDialog.saveButton.setDisabled( true );
this.saveDialog.$loadingIcon.show();
this.saveDialog.pushPending();
this.save( this.docToSave, saveOptions );
}
};

View file

@ -72,7 +72,7 @@ ve.ui.MWSaveDialog.static.title =
ve.ui.MWSaveDialog.prototype.setDiffAndReview = function ( content ) {
this.$reviewViewer.empty().append( content );
this.reviewGoodButton.setDisabled( false );
this.$loadingIcon.hide();
this.popPending();
this.swapPanel( 'review' );
};
@ -412,16 +412,13 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
} );
this.resolveConflictButton.connect( this, { 'click': [ 'emit', 'resolve' ] } );
this.$loadingIcon = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-working' );
// Initialization
this.$body.append( this.panel.$element );
this.$foot.append(
this.reviewButton.$element,
this.saveButton.$element,
this.reviewGoodButton.$element,
this.resolveConflictButton.$element,
this.$loadingIcon
this.resolveConflictButton.$element
);
this.setupDeferred.resolve();

View file

@ -75,16 +75,6 @@
color: #aaa;
}
.ve-ui-mwSaveDialog-working {
display: none;
float: right;
height: 2.5em;
width: 128px;
margin-right: 1em;
background-position: right center;
background-repeat: no-repeat;
}
.ve-ui-mwSaveDialog-license,
.ve-ui-mwSaveDialog-dirtymsg,
.ve-ui-mwSaveDialog-report-notice {