r108244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108243‎ | r108244 | r108245 >
Date:16:02, 6 January 2012
Author:hashar
Status:ok (Comments)
Tags:
Comment:
(bug 29309) allow CSS class per tooltip (tipsy)

Let us use the new "className" upstream option to add a class per tooltip.

Partial merges of upstreams changes:
- 602f2fe5 Per-tooltip classes
- f5563566 Helper function for call or return idiom
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/resources/jquery.tipsy/jquery.tipsy.js (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -119,6 +119,7 @@
120120 * (bug 33456) Show $wgQueryCacheLimit on cached query pages.
121121 * (bug 10574) Add an option to allow all pages to be exported by Special:Export.
122122 * Use mw.jqueryMsg parser for message parsing to support PLURAL and GENDER
 123+* (bug 29309) allow CSS class per tooltip (tipsy)
123124
124125 === Bug fixes in 1.19 ===
125126 * $wgUploadNavigationUrl should be used for file redlinks if.
Index: trunk/phase3/resources/jquery.tipsy/jquery.tipsy.js
@@ -4,7 +4,11 @@
55 // releated under the MIT license
66
77 (function($) {
8 -
 8+
 9+ function maybeCall(thing, ctx) {
 10+ return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
 11+ };
 12+
913 function fixTitle($ele) {
1014 if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') {
1115 $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title');
@@ -71,6 +75,9 @@
7276 }
7377
7478 $tip.css(tp).addClass('tipsy-' + gravity);
 79+ if (this.options.className) {
 80+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
 81+ }
7582
7683 if (this.options.fade) {
7784 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}, 100);
@@ -174,6 +181,7 @@
175182 };
176183
177184 $.fn.tipsy.defaults = {
 185+ className: null,
178186 delayIn: 0,
179187 delayOut: 0,
180188 fade: true,

Comments

#Comment by Johnduhart (talk | contribs)   19:35, 7 January 2012

I don't know how I feel about partial merging, why can't it just be updated completely instead of picking and choosing the revs we want? If it doesn't break anything, just update it.

#Comment by Hashar (talk | contribs)   21:56, 7 January 2012

I am sure this merge is harmless. The rest of the changes would require me to do a full review of tipsy and our usage of it in core + deployed extensions, something we are lacking time for :D

Meanwhile, I have asked upstream author to merge the pending pull requests and release a new version. We might then include that in 1.20.

Status & tagging log