+ var filename = this.filenameWidget.getValue();
+ if ( this.filenameExtension ) {
+ filename += '.' + this.filenameExtension;
+ }
+ return filename;
+ };
+
+ /**
+ * Prefills the {@link #infoForm information form} with the given filename.
+ *
+ * @protected
+ * @param {string} filename
+ */
+ mw.Upload.BookletLayout.prototype.setFilename = function ( filename ) {
+ var title = mw.Title.newFromFileName( filename );
+
+ if ( title ) {
+ this.filenameWidget.setValue( title.getNameText() );
+ this.filenameExtension = mw.Title.normalizeExtension( title.getExtension() );
+ } else {
+ // Seems to happen for files with no extension, which should fail some checks anyway...
+ this.filenameWidget.setValue( filename );
+ this.filenameExtension = null;
+ }