One copy would be added every time the user tried to save the file.
If they got an error and corrected it before trying again, there would
be two or more copies.
Bug: T116394
Change-Id: Ib4642d48e21d679ed675614efb29c77fa0e2c9c4
*/
mw.ForeignStructuredUpload.BookletLayout.prototype.getText = function () {
var language = mw.config.get( 'wgContentLanguage' );
+ this.upload.clearDescriptions();
this.upload.addDescription( language, this.descriptionWidget.getValue() );
this.upload.setDate( this.dateWidget.getValue() );
+ this.upload.clearCategories();
this.upload.addCategories( this.categoriesWidget.getItemsData() );
return this.upload.getText();
};
}
};
+ /**
+ * Empty the list of categories for the upload.
+ */
+ ForeignStructuredUpload.prototype.clearCategories = function () {
+ this.categories = [];
+ };
+
/**
* Add a description to the upload.
*
} );
};
+ /**
+ * Empty the list of descriptions for the upload.
+ */
+ ForeignStructuredUpload.prototype.clearDescriptions = function () {
+ this.descriptions = [];
+ };
+
/**
* Set the date of creation for the upload.
*