Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/142496
Change subject: Highlight the link pairs in source and translation sections
......................................................................
Highlight the link pairs in source and translation sections
Highlight on hover, identify the link pairs using data-linkid
attributes
Change-Id: I5f90d55a561c0b182308823bc9074793a09b0b42
---
M modules/source/ext.cx.source.js
M modules/translation/ext.cx.translation.js
M modules/translation/styles/ext.cx.translation.less
3 files changed, 19 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/96/142496/1
diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index 09ab610..a1722f2 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -126,6 +126,14 @@
// Disable link click
return false;
} );
+ this.$content.on( 'mouseenter', 'a', function () {
+ var linkid = $( this ).data( 'linkid' );
+ $( '[data-linkid="' + linkid + '"]' ).addClass(
'highlight' );
+ } );
+ this.$content.on( 'mouseleave', 'a', function () {
+ var linkid = $( this ).data( 'linkid' );
+ $( '[data-linkid="' + linkid + '"]' ).removeClass(
'highlight' );
+ } );
};
$.fn.cxSource = function ( options ) {
diff --git a/modules/translation/ext.cx.translation.js
b/modules/translation/ext.cx.translation.js
index fbf43a1..c66f294 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -103,6 +103,14 @@
$( targetSectionId ).replaceWith( $placeholder );
} );
+ this.$container.on( 'mouseenter', 'a', function () {
+ var linkid = $( this ).data( 'linkid' );
+ $( '[data-linkid="' + linkid + '"]' ).addClass(
'highlight' );
+ } );
+ this.$container.on( 'mouseleave', 'a', function () {
+ var linkid = $( this ).data( 'linkid' );
+ $( '[data-linkid="' + linkid + '"]' ).removeClass(
'highlight' );
+ } );
};
/**
diff --git a/modules/translation/styles/ext.cx.translation.less
b/modules/translation/styles/ext.cx.translation.less
index 7528c36..fd0182f 100644
--- a/modules/translation/styles/ext.cx.translation.less
+++ b/modules/translation/styles/ext.cx.translation.less
@@ -9,6 +9,9 @@
.mw-ui-one-whole;
padding-bottom: 10px;
}
+ .highlight {
+ background-color: #FFFEEC;
+ }
}
.placeholder {
--
To view, visit https://gerrit.wikimedia.org/r/142496
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f90d55a561c0b182308823bc9074793a09b0b42
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits