MediaWiki:Common.js: Difference between revisions

From VanRO Ragnarok Online
No edit summary
No edit summary
 
Line 1: Line 1:
this.descriptionWidget = new OO.ui.MultilineTextInputWidget( {
// Existing setup for the selectFileWidget
     required: false,
this.selectFileWidget = new OO.ui.SelectFileWidget({
     showDropTarget: true
});
this.selectFileWidget.on('change', function () {
    var file = layout.selectFileWidget.getValue();
      
      
     autosize: true,
     // Set the date to lastModified once we have the file
     disabled: true // Add this line to disable the widget
    if (layout.getDateFromLastModified(file) !== undefined) {
} );
        layout.dateWidget.setValue(layout.getDateFromLastModified(file));
    }
 
     // Check if we have EXIF data and set to that where available
    layout.getDateFromExif(file).done(function (date) {
        layout.dateWidget.setValue(date);
    });
 
    layout.updateFilePreview();
 
    // Automatically set a default description
    var defaultDescription = "Uploaded file " + (file ? file.name : "unknown");
    layout.descriptionWidget.setValue(defaultDescription);
});
 
// Remaining setup...

Latest revision as of 03:16, 15 May 2024

// Existing setup for the selectFileWidget
this.selectFileWidget = new OO.ui.SelectFileWidget({
    showDropTarget: true
});
this.selectFileWidget.on('change', function () {
    var file = layout.selectFileWidget.getValue();
    
    // Set the date to lastModified once we have the file
    if (layout.getDateFromLastModified(file) !== undefined) {
        layout.dateWidget.setValue(layout.getDateFromLastModified(file));
    }

    // Check if we have EXIF data and set to that where available
    layout.getDateFromExif(file).done(function (date) {
        layout.dateWidget.setValue(date);
    });

    layout.updateFilePreview();

    // Automatically set a default description
    var defaultDescription = "Uploaded file " + (file ? file.name : "unknown");
    layout.descriptionWidget.setValue(defaultDescription);
});

// Remaining setup...