Mattflaschen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/72676
Change subject: Add hooks and labels, initially to support GuidedTour
......................................................................
Add hooks and labels, initially to support GuidedTour
* Hooks for activation, deactivation, save dialog state change,
and tab setup.
* Class for save button (needed to point to edit in a clean way).
Also done for cancel button to be consistent, though GuidedTour
doesn't currently use this.
Change-Id: I4a0e0631d513fb09c3408f2f36a0de0bd51e1a37
---
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/76/72676/1
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index cceba19..61bff51 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -330,6 +330,7 @@
}
this.showTableOfContents();
this.deactivating = false;
+ mw.hook( 've.deactivationComplete' ).fire();
}
}
};
@@ -357,6 +358,7 @@
this.setupBeforeUnloadHandler();
this.$document[0].focus();
this.activating = false;
+ mw.hook( 've.activationComplete' ).fire();
}
};
@@ -1058,6 +1060,8 @@
$( '#ca-view a, #ca-nstab-visualeditor a' )
.click( ve.bind( this.onViewTabClick, this ) );
}
+
+ mw.hook( 've.skinTabSetupComplete' ).fire();
};
/**
@@ -1152,11 +1156,15 @@
var editNoticeCount = ve.getObjectKeys( this.editNotices ).length;
this.toolbarCancelButton = new ve.ui.ButtonWidget( { 'label': ve.msg(
'visualeditor-toolbar-cancel' ) } );
+ this.toolbarCancelButton.$.addClass( 've-ui-toolbar-cancelButton' );
this.toolbarSaveButton = new ve.ui.ButtonWidget( {
'label': ve.msg( 'visualeditor-toolbar-savedialog' ),
'flags': ['constructive'],
'disabled': !this.restoring
} );
+ // TODO (mattflaschen, 2013-06-27): it would be useful to do this in a
more general way, such
+ // as in the ButtonWidget constructor.
+ this.toolbarSaveButton.$.addClass( 've-ui-toolbar-saveButton' );
this.toolbarCancelButton.connect( this, { 'click':
'onToolbarCancelButtonClick' } );
this.toolbarSaveButton.connect( this, { 'click':
'onToolbarSaveButtonClick' } );
@@ -1597,6 +1605,8 @@
// Show the target slide
$slide.show();
+ mw.hook( 've.saveDialog.stateChanged' ).fire();
+
if ( slide === 'save' ) {
setTimeout( function () {
$slide.find( 'textarea' ).eq( 0 ).focus();
--
To view, visit https://gerrit.wikimedia.org/r/72676
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a0e0631d513fb09c3408f2f36a0de0bd51e1a37
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits