r57918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57917‎ | r57918 | r57919 >
Date:21:09, 19 October 2009
Author:adam
Status:deferred (Comments)
Tags:
Comment:
fixing a descrepency with the buffer space on expanding a tab
Modified paths:
  • /trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.collapsibleTabs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.php
@@ -18,7 +18,7 @@
1919
2020 /* Configuration */
2121 // Bump the version number every time you change any of the .css/.js files
22 -$wgCollapsibleTabsStyleVersion = 3;
 22+$wgCollapsibleTabsStyleVersion = 4;
2323
2424 /* Setup */
2525
@@ -27,7 +27,7 @@
2828 'path' => __FILE__,
2929 'name' => 'CollapsibleTabs',
3030 'author' => 'Adam Miller',
31 - 'version' => '0.0.1',
 31+ 'version' => '0.0.4',
3232 'url' => 'http://www.mediawiki.org/wiki/Extension:CollapsibleTabs',
3333 'descriptionmsg' => 'collapsibletabs-desc',
3434 );
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -60,7 +60,7 @@
6161 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
6262 array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 3 ),
6363 array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 3 ),
64 - array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 2 ),
 64+ array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 4 ),
6565 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ),
6666 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
6767 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.collapsibleTabs.js
@@ -40,7 +40,7 @@
4141 collapsible: 'li.collapsible',
4242 shifting: false,
4343 expandCondition: function(eleWidth) {
44 - return ( $('#left-navigation').position().left + $('#left-navigation').width() + 4)
 44+ return ( $('#left-navigation').position().left + $('#left-navigation').width() - 4)
4545 < ($('#right-navigation').position().left - eleWidth);
4646 },
4747 collapseCondition: function() {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -263,7 +263,7 @@
264264 collapsible: 'li.collapsible',
265265 shifting: false,
266266 expandCondition: function(eleWidth) {
267 - return ( $('#left-navigation').position().left + $('#left-navigation').width() + 4)
 267+ return ( $('#left-navigation').position().left + $('#left-navigation').width() - 4)
268268 < ($('#right-navigation').position().left - eleWidth);
269269 },
270270 collapseCondition: function() {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -18,7 +18,7 @@
1919 $text.attr('title',text);}});};})(jQuery);(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}
2020 return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}
2121 if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}
22 -r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);(function($){$.fn.collapsibleTabs=function($$options){if(!this.length)return this;var $settings=$.extend({},$.collapsibleTabs.defaults,$$options);this.each(function(){var $this=$(this);$.collapsibleTabs.instances=($.collapsibleTabs.instances.length==0?$this:$.collapsibleTabs.instances.add($this));$this.data('collapsibleTabsSettings',$settings);$this.children($settings.collapsible).each(function(){var $collapsible=$(this);$collapsible.data('collapsibleTabsSettings',{'expandedContainer':$settings.expandedContainer,'collapsedContainer':$settings.collapsedContainer,'expandedWidth':$collapsible.width(),'prevElement':$collapsible.prev()});});});if(!$.collapsibleTabs.boundEvent)$(window).delayedBind('500','resize',function(){$.collapsibleTabs.handleResize();});$.collapsibleTabs.handleResize();return this;};$.collapsibleTabs={instances:[],boundEvent:null,defaults:{expandedContainer:'#p-views ul',collapsedContainer:'#p-cactions ul',collapsible:'li.collapsible',shifting:false,expandCondition:function(eleWidth){return($('#left-navigation').position().left+$('#left-navigation').width()+4)<($('#right-navigation').position().left-eleWidth);},collapseCondition:function(){return($('#left-navigation').position().left+$('#left-navigation').width()+4)>$('#right-navigation').position().left;}},handleResize:function(e){$.collapsibleTabs.instances.each(function(){var $this=$(this),data=$this.data('collapsibleTabsSettings');if(data.shifting)return;if($this.children(data.collapsible).length>0&&data.collapseCondition()){$this.trigger("beforeTabCollapse");$.collapsibleTabs.moveToCollapsed($this.children(data.collapsible+':last'));}
 22+r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);(function($){$.fn.collapsibleTabs=function($$options){if(!this.length)return this;var $settings=$.extend({},$.collapsibleTabs.defaults,$$options);this.each(function(){var $this=$(this);$.collapsibleTabs.instances=($.collapsibleTabs.instances.length==0?$this:$.collapsibleTabs.instances.add($this));$this.data('collapsibleTabsSettings',$settings);$this.children($settings.collapsible).each(function(){var $collapsible=$(this);$collapsible.data('collapsibleTabsSettings',{'expandedContainer':$settings.expandedContainer,'collapsedContainer':$settings.collapsedContainer,'expandedWidth':$collapsible.width(),'prevElement':$collapsible.prev()});});});if(!$.collapsibleTabs.boundEvent)$(window).delayedBind('500','resize',function(){$.collapsibleTabs.handleResize();});$.collapsibleTabs.handleResize();return this;};$.collapsibleTabs={instances:[],boundEvent:null,defaults:{expandedContainer:'#p-views ul',collapsedContainer:'#p-cactions ul',collapsible:'li.collapsible',shifting:false,expandCondition:function(eleWidth){return($('#left-navigation').position().left+$('#left-navigation').width()-4)<($('#right-navigation').position().left-eleWidth);},collapseCondition:function(){return($('#left-navigation').position().left+$('#left-navigation').width()+4)>$('#right-navigation').position().left;}},handleResize:function(e){$.collapsibleTabs.instances.each(function(){var $this=$(this),data=$this.data('collapsibleTabsSettings');if(data.shifting)return;if($this.children(data.collapsible).length>0&&data.collapseCondition()){$this.trigger("beforeTabCollapse");$.collapsibleTabs.moveToCollapsed($this.children(data.collapsible+':last'));}
2323 if($(data.collapsedContainer+' '+data.collapsible).length>0&&data.expandCondition($(data.collapsedContainer).children(data.collapsible+":first").data('collapsibleTabsSettings').expandedWidth)){$this.trigger("beforeTabExpand");$.collapsibleTabs.moveToExpanded(data.collapsedContainer+" "+data.collapsible+':first');}});},moveToCollapsed:function(ele){var $moving=$(ele);var data=$moving.data('collapsibleTabsSettings');$(data.expandedContainer).data('collapsibleTabsSettings').shifting=true;$moving.remove().prependTo(data.collapsedContainer).data('collapsibleTabsSettings',data);$(data.expandedContainer).data('collapsibleTabsSettings').shifting=false;$.collapsibleTabs.handleResize();},moveToExpanded:function(ele){var $moving=$(ele);var data=$moving.data('collapsibleTabsSettings');$(data.expandedContainer).data('collapsibleTabsSettings').shifting=true;$moving.remove().insertAfter(data.prevElement).data('collapsibleTabsSettings',data);$(data.expandedContainer).data('collapsibleTabsSettings').shifting=false;$.collapsibleTabs.handleResize();}};})(jQuery);jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
2424 var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
2525 expires='; expires='+date.toUTCString();}

Follow-up revisions

RevisionCommit summaryAuthorDate
r57921Addressing Roan's feedback on r57918adam21:41, 19 October 2009
r59204wmf-deployment: Merging usability changes from trunk...catrope18:53, 18 November 2009

Comments

#Comment by Catrope (talk | contribs)   21:15, 19 October 2009
  • You also need to update the version numbers for plugins.combined.js and plugins.combined.min.js
  • What's the +4/-4 doing in there? What is the hardcoded 4px difference for?

Status & tagging log