jenkins-bot has submitted this change and it was merged.

Change subject: Add hooks and classes, initially to support GuidedTour
......................................................................


Add hooks and classes, initially to support GuidedTour

* Hooks for activation, deactivation, save dialog state change,
  and tab setup.
* Class for save button (needed to point to it 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-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index e3856d8..365c931 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -292,6 +292,7 @@
                        }
                        this.showTableOfContents();
                        this.deactivating = false;
+                       mw.hook( 've.deactivationComplete' ).fire();
                }
        }
 };
@@ -320,6 +321,7 @@
                        this.setupBeforeUnloadHandler();
                        this.$document[0].focus();
                        this.activating = false;
+                       mw.hook( 've.activationComplete' ).fire();
                }, this ) );
        }
 };
@@ -1083,6 +1085,8 @@
                $( '#ca-view a, #ca-nstab-visualeditor a' )
                        .click( ve.bind( this.onViewTabClick, this ) );
        }
+
+       mw.hook( 've.skinTabSetupComplete' ).fire();
 };
 
 /**
@@ -1101,11 +1105,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.updateToolbarSaveButtonState();
 
        this.toolbarCancelButton.connect( this, { 'click': 
'onToolbarCancelButtonClick' } );
@@ -1558,6 +1566,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: merged
Gerrit-Change-Id: I4a0e0631d513fb09c3408f2f36a0de0bd51e1a37
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to