Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/60241
Change subject: ViewPageTarget: Refactor 'replace' tabLayout
......................................................................
ViewPageTarget: Refactor 'replace' tabLayout
The 'add' tabLayout path is pretty basic and up to date. The
older (now active again) tabLayout 'replace' was fairly outdated
and unmaintained.
Fixes:
* Attributes copied from the original (except for the 'id'
attribute) were not actually beinged copied over because they
don't exist on the ca-edit list item, but on the anchor link
inside that list item.
* Clean up messages from the module registry that were unused.
Keys 'accesskey-ca-edit' and 'tooltip-ca-edit' were also inexistant.
* Add message keys for tooltip and accesskey of editsource tab.
Bug: 47396
Change-Id: If598552fac639da645a8b1273c5fc6028695fcc1
---
M VisualEditor.i18n.php
M VisualEditor.php
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
3 files changed, 20 insertions(+), 20 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/41/60241/1
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index 9c241ab..e23fa6c 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -5,6 +5,12 @@
* @author Trevor Parscal
*/
$messages['en'] = array(
+ 'accesskey-ca-editsource' => '',
+ 'accesskey-ca-ve-edit' => '',
+ 'tag-visualeditor' => '[[Special:Tags|Tag]]:
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]',
+ 'tag-visualeditor-description' => 'Edit made using the
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]',
+ 'tooltip-ca-editsource' => 'Edit the source code of this page',
+ 'tooltip-ca-ve-edit' => 'Edit this page with VisualEditor',
'visualeditor' => 'VisualEditor',
'visualeditor-desc' => 'Visual editor for MediaWiki',
'visualeditor-preference-enable' => 'Enable VisualEditor (only in the
[[{{MediaWiki:Visualeditor-mainnamespacepagelink}}|main]] and
[[{{MediaWiki:Visualeditor-usernamespacepagelink}}|user]] namespaces)',
@@ -35,8 +41,6 @@
'visualeditor-savedialog-label-restore' => 'Restore page',
'visualeditor-editnotices-tool' => '$1 {{PLURAL:$1|notice|notices}}',
'visualeditor-feedback-tool' => 'Leave feedback',
- 'tooltip-ca-ve-edit' => 'Edit this page with VisualEditor',
- 'accesskey-ca-ve-edit' => '',
'visualeditor-window-title' => 'Inspect',
'visualeditor-linkinspector-title' => 'Hyperlink',
'visualeditor-linkinspector-suggest-existing-page' => 'Existing page',
@@ -72,8 +76,6 @@
'visualeditor-editsummary' => 'Describe what you changed',
'visualeditor-problem' => 'Describe what went wrong',
'visualeditor-aliennode-tooltip' => 'Sorry, this element cannot be
edited using the VisualEditor',
- 'tag-visualeditor' => '[[Special:Tags|Tag]]:
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]',
- 'tag-visualeditor-description' => 'Edit made using the
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]',
'visualeditor-descriptionpagelink' => 'Project:VisualEditor',
'visualeditor-alphawarning' => 'You are using an alpha version of the
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]. It may be slow
and make erroneous changes - please check each edit that you make.',
'visualeditor-report-notice' => 'I understand that by clicking to
submit I will transmit my changes and my feedback which will be stored for
analysis. I agree to provide feedback in accordance with the
[[{{MediaWiki:Visualeditor-report-link}}|Terms of Use]].',
diff --git a/VisualEditor.php b/VisualEditor.php
index a3f5a96..40b30c7 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -144,20 +144,17 @@
'watchthis',
'copyrightwarning',
'copyrightpage',
- 'edit',
- 'create',
- 'accesskey-ca-edit',
+ 'accesskey-ca-editsource',
'accesskey-ca-ve-edit',
- 'tooltip-ca-edit',
+ 'tooltip-ca-editsource',
'tooltip-ca-ve-edit',
- 'viewsource',
+ 'visualeditor-ca-editsource',
'visualeditor-ca-ve-edit',
'visualeditor-ca-ve-create',
'visualeditor-notification-saved',
'visualeditor-notification-created',
'visualeditor-notification-restored',
'visualeditor-notification-reported',
- 'visualeditor-ca-editsource',
'visualeditor-loadwarning',
'visualeditor-editsummary',
'visualeditor-problem',
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 0b283b3..6e11438 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -719,8 +719,9 @@
* @method
*/
ve.init.mw.ViewPageTarget.prototype.setupSkinTabs = function () {
- var action, pTabsId, $caSource, $caEdit, caVeEdit, caVeEditSource,
caVeEditNextnode, uriClone;
+ var action, pTabsId, $caSource, $caEdit, $caEditA, caVeEdit,
caVeEditSource, caVeEditNextnode, uriClone;
$caEdit = $( '#ca-edit' );
+ $caEditA = $caEdit.find( 'a' );
$caSource = $( '#ca-viewsource' );
caVeEditNextnode = $caEdit.next().get( 0 );
@@ -733,9 +734,9 @@
action = this.pageExists ? 'edit' : 'create';
pTabsId = $( '#p-views' ).length ? 'p-views' : 'p-cactions';
- // Add independent ve-edit tab.
+ // Add independent "VisualEditor" tab (#ca-ve-edit).
if ( this.tabLayout === 'add' ) {
- // Create "Edit" tab.
+
caVeEdit = mw.util.addPortletLink(
pTabsId,
// Use url instead of '#'.
@@ -752,18 +753,18 @@
caVeEditNextnode
);
- // Replace edit with ve version, add editsource link.
+ // Replace "Edit" tab with a veEditUri version, add "Edit source" tab.
} else {
// Create "Edit source" link.
// Re-create instead of convert ca-edit since we don't want to
copy over accesskey etc.
caVeEditSource = mw.util.addPortletLink(
pTabsId,
// Use original href to preserve oldid etc. (bug 38125)
- $caEdit.find( 'a' ).attr( 'href' ),
+ $caEditA.attr( 'href' ),
ve.msg( 'visualeditor-ca-editsource' ),
'ca-editsource',
- null,
- null,
+ ve.msg( 'tooltip-ca-editsource' ),
+ ve.msg( 'accesskey-ca-editsource' ),
caVeEditNextnode
);
@@ -777,10 +778,10 @@
// 2) when onEditTabClick is not bound (!isViewPage) it
will
// just work.
this.veEditUri,
- $caEdit.text(),
+ $caEditA.text(),
$caEdit.attr( 'id' ),
- $caEdit.attr( 'title' ),
- $caEdit.attr( 'accesskey' ),
+ $caEditA.attr( 'title' ),
+ $caEditA.attr( 'accesskey' ),
caVeEditSource
);
}
--
To view, visit https://gerrit.wikimedia.org/r/60241
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If598552fac639da645a8b1273c5fc6028695fcc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits