| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
function UploadSelectFileParamWidget() { |
| 9 |
UploadSelectFileParamWidget.super.call( this ); |
| 10 |
} |
| 11 |
|
| 12 |
OO.inheritClass( UploadSelectFileParamWidget, OO.ui.SelectFileInputWidget ); |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
UploadSelectFileParamWidget.prototype.getApiValueForDisplay = function () { |
| 18 |
return '...'; |
| 19 |
}; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
UploadSelectFileParamWidget.prototype.requiresFormData = function () { |
| 25 |
return true; |
| 26 |
}; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
UploadSelectFileParamWidget.prototype.getApiValue = function () { |
| 32 |
return this.getValue(); |
| 33 |
}; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
UploadSelectFileParamWidget.prototype.setApiValue = function () { |
| 40 |
|
| 41 |
}; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
UploadSelectFileParamWidget.prototype.apiCheckValid = function ( shouldSuppressErrors ) { |
| 48 |
const ok = this.getValue() !== null && this.getValue() !== undefined || shouldSuppressErrors; |
| 49 |
this.info.setIcon( ok ? null : 'alert' ); |
| 50 |
this.setTitle( ok ? '' : mw.message( 'apisandbox-alert-field' ).plain() ); |
| 51 |
return $.Deferred().resolve( ok ).promise(); |
| 52 |
}; |
| 53 |
|
| 54 |
module.exports = UploadSelectFileParamWidget; |