2012-06-11 06:54:41 +00:00
|
|
|
/**
|
|
|
|
* Edit page target.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @constructor
|
|
|
|
* @extends {ve.init.Target}
|
|
|
|
* @param {String} title Page title of target
|
|
|
|
*/
|
2012-06-11 23:06:35 +00:00
|
|
|
ve.init.ViewPageTarget = function() {
|
2012-06-11 06:54:41 +00:00
|
|
|
// Inheritance
|
2012-06-19 04:47:09 +00:00
|
|
|
ve.init.Target.call( this, mw.config.get( 'wgRelevantPageName' ) );
|
2012-06-11 06:54:41 +00:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
this.$surface = $( '<div class="ve-surface"></div>' );
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document = null;
|
2012-06-18 20:12:32 +00:00
|
|
|
this.$spinner = $( '<div class="ve-init-viewPageTarget-loadingSpinner"></div>' );
|
|
|
|
this.$toolbarSaveButton = $( '<div class="ve-init-viewPageTarget-toolbar-saveButton"></div>' );
|
|
|
|
this.$saveDialog = $( '<div class="es-inspector ve-init-viewPageTarget-saveDialog"></div>' );
|
2012-06-11 06:54:41 +00:00
|
|
|
this.surface = null;
|
|
|
|
this.active = false;
|
2012-06-12 17:32:10 +00:00
|
|
|
this.edited = false;
|
2012-06-14 01:26:21 +00:00
|
|
|
this.activating = false;
|
2012-06-14 21:31:08 +00:00
|
|
|
this.deactivating = false;
|
2012-06-18 20:12:32 +00:00
|
|
|
this.scrollTop = null;
|
2012-06-12 17:32:10 +00:00
|
|
|
this.proxiedOnSurfaceModelTransact = ve.proxy( this.onSurfaceModelTransact, this );
|
2012-06-18 20:12:32 +00:00
|
|
|
this.surfaceOptions = { 'toolbars': { 'top': { 'float': !this.isMobileDevice } } };
|
2012-06-18 23:18:48 +00:00
|
|
|
this.currentUri = new mw.Uri( window.location.toString() );
|
|
|
|
this.section = this.currentUri.query.vesection || null;
|
2012-06-19 04:47:09 +00:00
|
|
|
this.namespaceName = mw.config.get( 'wgCanonicalNamespace' );
|
|
|
|
this.viewUri = new mw.Uri( mw.util.wikiGetlink( this.pageName ) );
|
|
|
|
this.editUri = new mw.Uri( this.viewUri.toString() );
|
|
|
|
this.editUri.extend( { 'action': 'edit' } );
|
|
|
|
this.veEditUri = new mw.Uri( this.viewUri.toString() );
|
|
|
|
this.veEditUri.extend( { 'veaction': 'edit' } );
|
2012-06-18 23:18:48 +00:00
|
|
|
this.isViewPage = (
|
2012-06-19 04:47:09 +00:00
|
|
|
this.namespaceName === 'VisualEditor' &&
|
2012-06-18 23:18:48 +00:00
|
|
|
mw.config.get( 'wgAction' ) === 'view' &&
|
|
|
|
this.currentUri.query.diff === undefined
|
|
|
|
);
|
|
|
|
this.canBeActivated = (
|
2012-06-19 04:47:09 +00:00
|
|
|
this.namespaceName === 'VisualEditor' ||
|
|
|
|
this.pageName.substr( 0, 13 ) === 'VisualEditor:'
|
2012-06-18 23:18:48 +00:00
|
|
|
);
|
2012-06-18 20:12:32 +00:00
|
|
|
|
|
|
|
// Events
|
|
|
|
this.addListenerMethods( this, {
|
|
|
|
'load': 'onLoad',
|
|
|
|
'save': 'onSave',
|
|
|
|
'loadError': 'onLoadError',
|
|
|
|
'saveError': 'onSaveError'
|
|
|
|
} );
|
2012-06-11 06:54:41 +00:00
|
|
|
|
|
|
|
// Initialization
|
2012-06-18 23:18:48 +00:00
|
|
|
if ( this.canBeActivated ) {
|
|
|
|
this.setupSkinTabs();
|
|
|
|
this.setupSectionEditLinks();
|
|
|
|
if ( this.isViewPage ) {
|
2012-06-18 21:13:26 +00:00
|
|
|
this.setupToolbarSaveButton();
|
|
|
|
this.setupSaveDialog();
|
2012-06-18 23:18:48 +00:00
|
|
|
if ( this.currentUri.query.veaction === 'edit' ) {
|
2012-06-18 21:13:26 +00:00
|
|
|
this.activate();
|
|
|
|
}
|
|
|
|
}
|
2012-06-11 06:54:41 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Static Members */
|
|
|
|
|
|
|
|
/*jshint multistr: true*/
|
2012-06-11 23:06:35 +00:00
|
|
|
ve.init.ViewPageTarget.saveDialogTemplate = '\
|
|
|
|
<div class="es-inspector-title ve-init-viewPageTarget-saveDialog-title"></div>\
|
|
|
|
<div class="es-inspector-button ve-init-viewPageTarget-saveDialog-closeButton"></div>\
|
|
|
|
<div class="ve-init-viewPageTarget-saveDialog-body">\
|
|
|
|
<div class="ve-init-viewPageTarget-saveDialog-editSummary-label"></div>\
|
|
|
|
<input name="editSummary" id="ve-init-viewPageTarget-saveDialog-editSummary" type="text">\
|
2012-06-11 06:54:41 +00:00
|
|
|
<div class="clear:both"></div>\
|
2012-06-11 23:06:35 +00:00
|
|
|
<div class="ve-init-viewPageTarget-saveDialog-options">\
|
2012-06-11 06:54:41 +00:00
|
|
|
<input type="checkbox" name="minorEdit" \
|
2012-06-11 23:06:35 +00:00
|
|
|
id="ve-init-viewPageTarget-saveDialog-minorEdit">\
|
|
|
|
<label class="ve-init-viewPageTarget-saveDialog-minorEdit-label" \
|
2012-06-19 08:30:30 +00:00
|
|
|
for="ve-init-viewPageTarget-saveDialog-minorEdit"></label>\
|
2012-06-11 06:54:41 +00:00
|
|
|
<div style="clear:both"></div>\
|
|
|
|
<input type="checkbox" name="watchList" \
|
2012-06-11 23:06:35 +00:00
|
|
|
id="ve-init-viewPageTarget-saveDialog-watchList">\
|
|
|
|
<label class="ve-init-viewPageTarget-saveDialog-watchList-label" \
|
2012-06-19 08:30:30 +00:00
|
|
|
for="ve-init-viewPageTarget-saveDialog-watchList"></label>\
|
2012-06-11 06:54:41 +00:00
|
|
|
</div>\
|
2012-06-11 23:06:35 +00:00
|
|
|
<div class="ve-init-viewPageTarget-button ve-init-viewPageTarget-saveDialog-saveButton">\
|
|
|
|
<span class="ve-init-viewPageTarget-saveDialog-saveButton-label"></span>\
|
|
|
|
<div class="ve-init-viewPageTarget-saveDialog-saveButton-icon"></div>\
|
2012-06-11 06:54:41 +00:00
|
|
|
</div>\
|
|
|
|
<div style="clear:both"></div>\
|
|
|
|
</div>\
|
2012-06-11 23:06:35 +00:00
|
|
|
<div class="ve-init-viewPageTarget-saveDialog-foot">\
|
|
|
|
<p class="ve-init-viewPageTarget-saveDialog-license"></p>\
|
2012-06-18 20:12:32 +00:00
|
|
|
</div>';
|
2012-06-11 06:54:41 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Switches to edit mode.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.activate = function() {
|
2012-06-14 01:26:21 +00:00
|
|
|
if ( !this.active && !this.activating ) {
|
|
|
|
this.activating = true;
|
2012-06-18 20:12:32 +00:00
|
|
|
// User interface changes
|
|
|
|
this.transformSkinTabs();
|
2012-06-11 06:54:41 +00:00
|
|
|
this.showSpinner();
|
2012-06-18 20:12:32 +00:00
|
|
|
this.hideTableOfContents();
|
|
|
|
this.mutePageContent();
|
|
|
|
this.mutePageTitle();
|
|
|
|
this.saveScrollPosition();
|
|
|
|
this.load();
|
2012-06-11 06:54:41 +00:00
|
|
|
}
|
2012-06-14 21:31:08 +00:00
|
|
|
};
|
|
|
|
|
2012-06-12 01:21:31 +00:00
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Switches to view mode.
|
2012-06-12 01:21:31 +00:00
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
2012-06-19 00:39:31 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.deactivate = function( override ) {
|
2012-06-14 21:31:08 +00:00
|
|
|
if ( this.active && !this.deactivating ) {
|
2012-06-12 17:32:10 +00:00
|
|
|
if (
|
2012-06-19 00:39:31 +00:00
|
|
|
override ||
|
2012-06-12 17:32:10 +00:00
|
|
|
!this.surface.getModel().getHistory().length ||
|
2012-06-19 08:30:30 +00:00
|
|
|
confirm( mw.msg( 'visualeditor-viewpage-savewarning' ) )
|
2012-06-12 17:32:10 +00:00
|
|
|
) {
|
2012-06-18 20:12:32 +00:00
|
|
|
this.deactivating = true;
|
|
|
|
// User interface changes
|
|
|
|
this.restoreSkinTabs();
|
|
|
|
this.hideSpinner();
|
|
|
|
this.detachToolbarSaveButton();
|
|
|
|
this.detachSaveDialog();
|
2012-06-12 17:32:10 +00:00
|
|
|
this.tearDownSurface();
|
2012-06-18 20:12:32 +00:00
|
|
|
this.showTableOfContents();
|
2012-06-14 21:31:08 +00:00
|
|
|
this.deactivating = false;
|
2012-06-12 17:32:10 +00:00
|
|
|
}
|
2012-06-12 01:21:31 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-06-11 06:54:41 +00:00
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles successful DOM load event.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {HTMLElement} dom Parsed DOM from server
|
2012-06-11 06:54:41 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onLoad = function( dom ) {
|
|
|
|
this.edited = false;
|
|
|
|
this.setUpSurface( dom );
|
|
|
|
this.attachToolbarSaveButton();
|
|
|
|
this.attachSaveDialog();
|
|
|
|
this.restoreScrollPosition();
|
|
|
|
this.restoreEditSection();
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document.focus();
|
2012-06-18 20:12:32 +00:00
|
|
|
this.activating = false;
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
2012-06-12 17:32:10 +00:00
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles failed DOM load event.
|
2012-06-12 17:32:10 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {Object} data HTTP Response object
|
|
|
|
* @param {String} status Text status message
|
|
|
|
* @param {Mixed} error Thrown exception or HTTP error string
|
2012-06-12 17:32:10 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onLoadError = function( response, status, error ) {
|
|
|
|
// TODO: Something...
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles successful DOM save event.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {HTMLElement} html Rendered HTML from server
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.onSave = function( html ) {
|
|
|
|
this.hideSaveDialog();
|
2012-06-19 05:42:59 +00:00
|
|
|
this.resetSaveDialog();
|
2012-06-18 20:12:32 +00:00
|
|
|
this.replacePageContent( html );
|
2012-06-19 00:39:31 +00:00
|
|
|
this.deactivate( true );
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles failed DOM save event.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {Object} data HTTP Response object
|
|
|
|
* @param {String} status Text status message
|
|
|
|
* @param {Mixed} error Thrown exception or HTTP error string
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.onSaveError = function( response, status, error ) {
|
|
|
|
// TODO: Something...
|
2012-06-12 17:32:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles clicks on the edit tab.
|
2012-06-12 17:32:10 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {Event} e DOM event
|
2012-06-12 17:32:10 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onEditTabClick = function( event ) {
|
|
|
|
this.activate();
|
|
|
|
// Prevent the edit tab's normal behavior
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles clicks on a section edit link.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {Event} event DOM event
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.onEditSectionLinkClick = function( event ) {
|
2012-06-18 23:18:48 +00:00
|
|
|
this.saveEditSection( $( event.target ).closest( 'h1, h2, h3, h4, h5, h6' )[0] );
|
2012-06-18 20:12:32 +00:00
|
|
|
this.activate();
|
|
|
|
// Prevent the edit tab's normal behavior
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles clicks on the view tab.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {Event} event DOM event
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.onViewTabClick = function( event ) {
|
2012-06-18 21:53:22 +00:00
|
|
|
if ( this.active ) {
|
|
|
|
this.deactivate();
|
|
|
|
// Prevent the edit tab's normal behavior
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles clicks on the save button in the toolbar.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {Event} event DOM event
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.onToolbarSaveButtonClick = function( event ) {
|
2012-06-12 17:32:10 +00:00
|
|
|
if ( this.edited ) {
|
2012-06-18 20:12:32 +00:00
|
|
|
this.showSaveDialog();
|
2012-06-12 17:32:10 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles the first transaction in the surface model.
|
|
|
|
*
|
|
|
|
* This handler is removed the first time it's used, but added each time the surface is setup.
|
2012-06-12 17:32:10 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {ve.Transaction} tx Processed transaction
|
2012-06-12 17:32:10 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onSurfaceModelTransact = function( tx ) {
|
|
|
|
this.edited = true;
|
|
|
|
this.enableToolbarSaveButton();
|
|
|
|
this.surface.getModel().removeListener( 'transact', this.proxiedOnSurfaceModelTransact );
|
2012-06-12 17:32:10 +00:00
|
|
|
};
|
|
|
|
|
2012-06-11 06:54:41 +00:00
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles clicks on the save button in the save dialog.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {Event} event DOM event
|
2012-06-11 06:54:41 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onSaveDialogSaveButtonClick = function( event ) {
|
|
|
|
this.showSpinner();
|
|
|
|
// Save
|
|
|
|
this.save(
|
|
|
|
ve.dm.converter.getDomFromData( this.surface.getDocumentModel().getData() ),
|
|
|
|
{
|
|
|
|
'summary': $( '#ve-init-viewPageTarget-saveDialog-editSummary' ).val(),
|
|
|
|
'minor': $( '#ve-init-viewPageTarget-saveDialog-minorEdit' ).prop( 'checked' ),
|
|
|
|
'watch': $( '#ve-init-viewPageTarget-saveDialog-watchList' ).prop( 'checked' )
|
|
|
|
},
|
|
|
|
ve.proxy( this.onSave, this )
|
|
|
|
);
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Handles clicks on the close button in the save dialog.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {Event} event DOM event
|
2012-06-11 06:54:41 +00:00
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.onSaveDialogCloseButtonClick = function( event ) {
|
|
|
|
this.hideSaveDialog();
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Switches to editing mode.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
2012-06-18 20:12:32 +00:00
|
|
|
* @param {HTMLElement} dom HTML DOM to edit
|
2012-06-11 06:54:41 +00:00
|
|
|
*/
|
2012-06-11 23:06:35 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.setUpSurface = function( dom ) {
|
2012-06-11 06:54:41 +00:00
|
|
|
// Initialize surface
|
2012-06-18 20:12:32 +00:00
|
|
|
this.attachSurface();
|
2012-06-11 06:54:41 +00:00
|
|
|
this.surface = new ve.Surface( this.$surface, dom, this.surfaceOptions );
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document = this.$surface.find( '.ve-ce-documentNode' );
|
2012-06-12 17:32:10 +00:00
|
|
|
this.surface.getModel().on( 'transact', this.proxiedOnSurfaceModelTransact );
|
2012-06-11 06:54:41 +00:00
|
|
|
// Transplant the toolbar
|
2012-06-18 20:12:32 +00:00
|
|
|
this.attachToolbar();
|
|
|
|
this.transformPageTitle();
|
2012-06-11 06:54:41 +00:00
|
|
|
// Update UI
|
2012-06-18 20:12:32 +00:00
|
|
|
this.hidePageContent();
|
|
|
|
this.hideSpinner();
|
|
|
|
this.disableToolbarSaveButton();
|
2012-06-12 01:21:31 +00:00
|
|
|
this.active = true;
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
2012-06-18 20:12:32 +00:00
|
|
|
/**
|
|
|
|
* Switches to viewing mode.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.tearDownSurface = function() {
|
2012-06-11 06:54:41 +00:00
|
|
|
// Reset tabs
|
2012-06-18 20:12:32 +00:00
|
|
|
this.restoreSkinTabs();
|
2012-06-11 06:54:41 +00:00
|
|
|
// Update UI
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document.blur();
|
|
|
|
this.$document = null;
|
2012-06-12 01:21:31 +00:00
|
|
|
this.$surface.empty().detach();
|
2012-06-18 20:12:32 +00:00
|
|
|
this.detachToolbar();
|
|
|
|
this.hideSpinner();
|
|
|
|
this.showPageContent();
|
|
|
|
this.restorePageTitle();
|
|
|
|
this.showTableOfContents();
|
|
|
|
// Remove handler if it's still active
|
|
|
|
this.surface.getModel().removeListener( 'transact', this.proxiedOnSurfaceModelTransact );
|
2012-06-11 06:54:41 +00:00
|
|
|
// Destroy editor
|
|
|
|
this.surface = null;
|
2012-06-12 01:21:31 +00:00
|
|
|
this.active = false;
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
2012-06-18 20:12:32 +00:00
|
|
|
/**
|
|
|
|
* Modifies tabs in the skin to support in-place editing.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.setupSkinTabs = function() {
|
2012-06-11 06:54:41 +00:00
|
|
|
// Only sysop users will have an edit tab in this namespace, so we might need to add one
|
|
|
|
if ( $( '#ca-edit' ).length === 0 ) {
|
|
|
|
// Add edit tab
|
2012-06-18 23:53:03 +00:00
|
|
|
var action = Number( mw.config.get( 'wgArticleId', 0 ) ) === 0 ?
|
|
|
|
'create' : 'edit';
|
2012-06-11 06:54:41 +00:00
|
|
|
mw.util.addPortletLink(
|
|
|
|
'p-views',
|
|
|
|
'#',
|
2012-06-18 23:53:03 +00:00
|
|
|
mw.msg( action ), // 'edit' or 'create'
|
2012-06-11 06:54:41 +00:00
|
|
|
'ca-edit',
|
|
|
|
mw.msg( 'tooltip-ca-edit' ),
|
|
|
|
mw.msg( 'accesskey-ca-edit' ),
|
|
|
|
'#ca-history'
|
|
|
|
);
|
|
|
|
// If there isn't an edit tab, there's a view source tab we need to replace with edit source
|
|
|
|
var $viewSource = $( '#ca-viewsource' );
|
|
|
|
if ( $viewSource.length > 0 ) {
|
|
|
|
// "Move" the view source link to p-actions
|
|
|
|
mw.util.addPortletLink(
|
|
|
|
'p-cactions',
|
|
|
|
$viewSource.find( 'a' ).attr( 'href' ),
|
|
|
|
$viewSource.find( 'a' ).text(),
|
|
|
|
$viewSource.attr( 'id' )
|
|
|
|
);
|
|
|
|
// Remove the view original source link
|
|
|
|
$viewSource.remove();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Sysop users will need a new edit source tab since we are highjacking the edit tab
|
|
|
|
mw.util.addPortletLink(
|
|
|
|
'p-cactions',
|
2012-06-18 23:18:48 +00:00
|
|
|
this.editUri,
|
2012-06-19 08:30:30 +00:00
|
|
|
mw.msg( 'visualeditor-ca-editsource' ),
|
2012-06-11 06:54:41 +00:00
|
|
|
'ca-editsource'
|
|
|
|
);
|
|
|
|
}
|
2012-06-18 23:18:48 +00:00
|
|
|
if ( this.isViewPage ) {
|
|
|
|
// Allow instant-editing
|
2012-06-18 21:13:26 +00:00
|
|
|
$( '#ca-edit a' ).click( ve.proxy( this.onEditTabClick, this ) );
|
2012-06-18 21:19:07 +00:00
|
|
|
$( '#ca-view a, #ca-nstab-visualeditor a' ).click( ve.proxy( this.onViewTabClick, this ) );
|
2012-06-18 21:13:26 +00:00
|
|
|
} else {
|
2012-06-18 23:18:48 +00:00
|
|
|
// Route edits through the view page
|
|
|
|
$( '#ca-edit a' ).attr( 'href', this.veEditUri );
|
2012-06-18 21:13:26 +00:00
|
|
|
}
|
|
|
|
// Source editing shouldn't highlight the edit tab
|
|
|
|
if ( mw.config.get( 'wgAction' ) === 'edit' ) {
|
|
|
|
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
|
|
|
|
}
|
2012-06-18 21:53:22 +00:00
|
|
|
// Fix the URL if there was a veaction param in it
|
2012-06-18 23:18:48 +00:00
|
|
|
if ( this.currentUri.query.veaction === 'edit' && window.history.replaceState ) {
|
2012-06-18 21:53:22 +00:00
|
|
|
var title = $( 'head title' ).text();
|
2012-06-18 23:18:48 +00:00
|
|
|
window.history.replaceState( null, title, this.viewUri );
|
2012-06-18 21:53:22 +00:00
|
|
|
}
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Modifies page content to make section edit links activate the editor.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.setupSectionEditLinks = function() {
|
2012-06-18 23:18:48 +00:00
|
|
|
var $links = $( '#mw-content-text .editsection a' );
|
|
|
|
if ( this.isViewPage ) {
|
|
|
|
$links.click( ve.proxy( this.onEditSectionLinkClick, this ) );
|
|
|
|
} else {
|
2012-06-19 00:56:26 +00:00
|
|
|
var veEditUri = this.veEditUri;
|
2012-06-18 23:18:48 +00:00
|
|
|
$links.each( function() {
|
2012-06-19 00:56:26 +00:00
|
|
|
var veSectionEditUri = new mw.Uri( veEditUri.toString() ),
|
2012-06-18 23:18:48 +00:00
|
|
|
sectionEditUri = new mw.Uri( $(this).attr( 'href' ) );
|
|
|
|
veSectionEditUri.extend( { 'vesection': sectionEditUri.query.section } );
|
|
|
|
$(this).attr( 'href', veSectionEditUri );
|
|
|
|
} );
|
|
|
|
}
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds content and event bindings to the save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.setupToolbarSaveButton = function() {
|
|
|
|
this.$toolbarSaveButton
|
|
|
|
.append(
|
|
|
|
$( '<span class="ve-init-viewPageTarget-toolbar-saveButton-label"></span>' )
|
|
|
|
.text( mw.msg( 'savearticle' ) )
|
|
|
|
)
|
|
|
|
.append( $( '<span class="ve-init-viewPageTarget-toolbar-saveButton-icon"></span>' ) )
|
|
|
|
.mousedown( function( e ) {
|
|
|
|
$(this).addClass( 've-init-viewPageTarget-toolbar-saveButton-down' );
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
} )
|
|
|
|
.mouseup( function( e ) {
|
|
|
|
$(this).removeClass( 've-init-viewPageTarget-toolbar-saveButton-down' );
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
} )
|
|
|
|
.click( ve.proxy( this.onToolbarSaveButtonClick, this ) );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the save button to the user interface.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.attachToolbarSaveButton = function() {
|
|
|
|
$( '.es-toolbar .es-modes' ).append( this.$toolbarSaveButton );
|
|
|
|
this.disableToolbarSaveButton();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the save button from the user interface.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.detachToolbarSaveButton = function() {
|
|
|
|
this.$toolbarSaveButton.detach();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds content and event bindings to the save dialog.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.setupSaveDialog = function() {
|
|
|
|
this.$saveDialog
|
|
|
|
.html( ve.init.ViewPageTarget.saveDialogTemplate )
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-title' )
|
|
|
|
.text( mw.msg( 'tooltip-save' ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-closeButton' )
|
|
|
|
.click( ve.proxy( this.onSaveDialogCloseButtonClick, this ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-editSummary-label' )
|
|
|
|
.text( mw.msg( 'summary' ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-minorEdit-label' )
|
|
|
|
.text( mw.msg( 'minoredit' ) )
|
|
|
|
.end()
|
2012-06-19 05:42:59 +00:00
|
|
|
.find( '#ve-init-viewPageTarget-saveDialog-watchList' )
|
2012-06-18 20:12:32 +00:00
|
|
|
.prop( 'checked', mw.config.get( 'wgVisualEditor' ).isPageWatched )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-watchList-label' )
|
|
|
|
.text( mw.msg( 'watchthis' ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-saveButton' )
|
|
|
|
.click( ve.proxy( this.onSaveDialogSaveButtonClick, this ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-saveButton-label' )
|
|
|
|
.text( mw.msg( 'savearticle' ) )
|
|
|
|
.end()
|
|
|
|
.find( '.ve-init-viewPageTarget-saveDialog-license' )
|
2012-06-19 05:14:40 +00:00
|
|
|
// FIXME license text is hardcoded English
|
2012-06-18 20:12:32 +00:00
|
|
|
.html(
|
|
|
|
"By editing this page, you agree to irrevocably release your \
|
2012-06-19 05:14:40 +00:00
|
|
|
contributions under the CC-BY-SA 3.0 License. If you don't want your \
|
|
|
|
writing to be edited mercilessly and redistrubuted at will, then \
|
|
|
|
don't submit it here.<br /><br />You are also confirming that you \
|
2012-06-18 20:12:32 +00:00
|
|
|
wrote this yourself, or copied it from a public domain or similar free \
|
2012-06-19 05:14:40 +00:00
|
|
|
resource. See Project:Copyright for full details of the licenses \
|
2012-06-18 20:12:32 +00:00
|
|
|
used on this site.\
|
|
|
|
<b>DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!</b>"
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the save dialog to the user interface.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.attachSaveDialog = function() {
|
|
|
|
this.$saveDialog.insertAfter( this.$toolbarSaveButton );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the save dialog from the user interface.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.detachSaveDialog = function() {
|
|
|
|
this.$saveDialog.detach();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remembers the window's scroll position.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.saveScrollPosition = function() {
|
|
|
|
this.scrollTop = $( window ).scrollTop();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restores the window's scroll position.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.restoreScrollPosition = function() {
|
|
|
|
if ( this.scrollTop ) {
|
|
|
|
$( window ).scrollTop( this.scrollTop );
|
|
|
|
this.scrollTop = null;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the loading spinner.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
2012-06-11 23:06:35 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.showSpinner = function() {
|
2012-06-18 20:12:32 +00:00
|
|
|
this.$spinner.prependTo( $( '#firstHeading' ) );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the loading spinner.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.hideSpinner = function() {
|
|
|
|
this.$spinner.detach();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the page content.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.showPageContent = function() {
|
2012-06-19 00:39:31 +00:00
|
|
|
$( '#bodyContent .ve-init-viewPageTarget-content:not(#siteSub)' )
|
|
|
|
.removeClass( 've-init-viewPageTarget-content' )
|
|
|
|
.show()
|
|
|
|
.fadeTo( 0, 1 );
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mutes the page content.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.mutePageContent = function() {
|
2012-06-19 00:39:31 +00:00
|
|
|
$( '#bodyContent :visible:not(#siteSub)' )
|
|
|
|
.addClass( 've-init-viewPageTarget-content' )
|
2012-06-19 04:47:09 +00:00
|
|
|
.fadeTo( 'fast', 0.6 );
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the page content.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.hidePageContent = function() {
|
2012-06-19 00:39:31 +00:00
|
|
|
$( '#bodyContent :visible:not(#siteSub)' )
|
|
|
|
.addClass( 've-init-viewPageTarget-content' )
|
|
|
|
.hide();
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the table of contents in the view mode.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.showTableOfContents = function() {
|
|
|
|
$( '#toc' ).slideDown( 'fast', function() {
|
|
|
|
$(this).removeClass( 've-init-viewPageTarget-pageToc' );
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the table of contents in the view mode.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.hideTableOfContents = function() {
|
|
|
|
$( '#toc' ).addClass( 've-init-viewPageTarget-pageToc' ).slideUp( 'fast' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the save dialog.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.showSaveDialog = function() {
|
|
|
|
this.$saveDialog.fadeIn( 'fast' ).find( 'input:first' ).focus();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the save dialog
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.hideSaveDialog = function() {
|
|
|
|
this.$saveDialog.fadeOut( 'fast' );
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document.focus();
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
2012-06-19 05:42:59 +00:00
|
|
|
/**
|
|
|
|
* Resets the fields of the save dialog
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.resetSaveDialog = function() {
|
|
|
|
this.$saveDialog
|
|
|
|
.find( '#ve-init-viewPageTarget-saveDialog-editSummary' )
|
|
|
|
.val( '' )
|
|
|
|
.end()
|
|
|
|
.find( '#ve-init-viewPageTarget-saveDialog-minorEdit' )
|
|
|
|
.prop( 'checked', false );
|
|
|
|
};
|
|
|
|
|
2012-06-18 20:12:32 +00:00
|
|
|
/**
|
|
|
|
* Enables the toolbar save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.enableToolbarSaveButton = function() {
|
|
|
|
this.$toolbarSaveButton.removeClass( 've-init-viewPageTarget-toolbar-saveButton-disabled' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disables the toolbar save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.disableToolbarSaveButton = function() {
|
|
|
|
this.$toolbarSaveButton.addClass( 've-init-viewPageTarget-toolbar-saveButton-disabled' );
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-18 20:12:32 +00:00
|
|
|
* Shows the toolbar.
|
|
|
|
*
|
|
|
|
* This also transplants the toolbar to a new location.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
2012-06-18 20:12:32 +00:00
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.attachToolbar = function() {
|
|
|
|
$( '.es-toolbar-wrapper' )
|
|
|
|
.insertBefore( $( '#firstHeading' ) )
|
|
|
|
.find( '.es-toolbar' )
|
|
|
|
.slideDown( 'fast' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the toolbar.
|
2012-06-11 06:54:41 +00:00
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.detachToolbar = function() {
|
|
|
|
$( '.es-toolbar' ).slideUp( 'fast', function() {
|
|
|
|
$(this).parent().remove();
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enables the toolbar save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.transformPageTitle = function() {
|
|
|
|
$( '#firstHeading' ).addClass( 've-init-viewPageTarget-pageTitle' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enables the toolbar save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.mutePageTitle = function() {
|
2012-06-19 04:47:09 +00:00
|
|
|
$( '#firstHeading, #siteSub' ).fadeTo( 'fast', 0.6 );
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disables the toolbar save button.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.restorePageTitle = function() {
|
2012-06-19 04:47:09 +00:00
|
|
|
$( '#firstHeading, #siteSub' ).fadeTo( 'fast', 1 );
|
2012-06-18 20:12:32 +00:00
|
|
|
setTimeout( function() {
|
|
|
|
$( '#firstHeading' ).removeClass( 've-init-viewPageTarget-pageTitle' );
|
|
|
|
}, 1000 );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifies page tabs to show that editing is taking place.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.transformSkinTabs = function() {
|
2012-06-11 06:54:41 +00:00
|
|
|
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
|
2012-06-18 20:12:32 +00:00
|
|
|
$( '#ca-edit' ).addClass( 'selected' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifies page tabs to show that viewing is taking place.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.restoreSkinTabs = function() {
|
|
|
|
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
|
|
|
|
$( '#ca-view' ).addClass( 'selected' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replaces the page content with new HTML.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {HTMLElement} html Rendered HTML from server
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.replacePageContent = function( html ) {
|
|
|
|
$( '#mw-content-text' ).html( html );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attaches the surface to the page.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.attachSurface = function() {
|
|
|
|
$( '#content' ).append( this.$surface );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attaches the surface to the page.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.detachSurface = function() {
|
|
|
|
this.$surface.detach();
|
|
|
|
$( '.es-contextView' ).remove();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the numeric index of a section in the page.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {HTMLElement} heading Heading element of section
|
|
|
|
*/
|
2012-06-18 23:18:48 +00:00
|
|
|
ve.init.ViewPageTarget.prototype.getEditSection = function( heading ) {
|
|
|
|
var $page = $( '#mw-content-text' ),
|
2012-06-18 20:12:32 +00:00
|
|
|
section = 0;
|
2012-06-18 23:18:48 +00:00
|
|
|
$page.find( 'h1, h2, h3, h4, h5, h6' ).not( '#toc h2' ).each( function() {
|
|
|
|
section++;
|
2012-06-18 20:12:32 +00:00
|
|
|
if ( this === heading ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} );
|
2012-06-18 23:18:48 +00:00
|
|
|
return section;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the numeric index of a section in the page.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {HTMLElement} heading Heading element of section
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.saveEditSection = function( heading ) {
|
|
|
|
this.section = this.getEditSection( heading );
|
2012-06-18 20:12:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the cursor in the editor to a given section.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {Number} section Section to move cursor to
|
|
|
|
*/
|
|
|
|
ve.init.ViewPageTarget.prototype.restoreEditSection = function() {
|
2012-06-18 23:18:48 +00:00
|
|
|
if ( this.section !== null ) {
|
2012-06-18 20:12:32 +00:00
|
|
|
var surfaceView = this.surface.getView(),
|
|
|
|
surfaceModel = surfaceView.getModel();
|
2012-06-19 17:50:33 +00:00
|
|
|
this.$document.find( 'h1, h2, h3, h4, h5, h6' ).eq( this.section - 1 ).each( function() {
|
|
|
|
var headingNode = $(this).data( 'node' );
|
|
|
|
if ( headingNode ) {
|
|
|
|
var offset = surfaceModel.getDocument().getNearestContentOffset(
|
|
|
|
headingNode.getModel().getOffset()
|
|
|
|
);
|
|
|
|
surfaceModel.change( null, new ve.Range( offset, offset ) );
|
|
|
|
surfaceView.showSelection( surfaceModel.getSelection() );
|
|
|
|
}
|
|
|
|
} );
|
2012-06-18 20:12:32 +00:00
|
|
|
this.section = null;
|
|
|
|
}
|
2012-06-11 06:54:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2012-06-11 23:06:35 +00:00
|
|
|
ve.extendClass( ve.init.ViewPageTarget, ve.init.Target );
|
2012-06-11 06:54:41 +00:00
|
|
|
|
|
|
|
/* Initialization */
|
|
|
|
|
2012-06-18 20:12:32 +00:00
|
|
|
ve.init.viewPageTarget = new ve.init.ViewPageTarget();
|