Merge "screenshots: Fix environment setup"

This commit is contained in:
jenkins-bot 2023-07-05 13:32:32 +00:00 committed by Gerrit Code Review
commit 81b256ca4f
2 changed files with 10 additions and 8 deletions

View file

@ -15,8 +15,7 @@ module.exports = function ( grunt ) {
timeout: 5 * 60 * 1000,
require: [
function () {
// eslint-disable-next-line no-undef
langs = [ grunt.option( 'lang' ) || 'en' ];
global.langs = [ grunt.option( 'lang' ) || 'en' ];
}
]
},
@ -27,8 +26,7 @@ module.exports = function ( grunt ) {
timeout: 5 * 60 * 1000,
require: [
function () {
// eslint-disable-next-line no-undef
langs = require( './build/tasks/screenshotLangs.json' ).langs;
global.langs = require( './build/tasks/screenshotLangs.json' ).langs;
}
]
};

View file

@ -101,12 +101,16 @@ module.exports = function () {
mw.hook( 've.activationComplete' ).add( function () {
var target = ve.init.target,
surfaceView = target.getSurface().getView();
// Modify the document to make the save button blue
// Wait for focus
surfaceView.once( 'focus', function () {
target.surface.getModel().getFragment().insertContent( ' ' ).collapseToStart().select();
// eslint-disable-next-line no-jquery/no-deferred
var welcomeDialogPromise = target.welcomeDialogPromise || $.Deferred().resolve().promise();
welcomeDialogPromise.then( function () {
// Hide edit notices
target.toolbar.tools.notices.getPopup().toggle( false );
surfaceView.focus();
// Modify the document to make the save button blue
target.surface.getModel().getFragment().insertContent( ' ' ).collapseToStart().select();
// Wait for save button fade
setTimeout( function () {
veDone( { width: window.innerWidth, height: window.innerHeight } );