r67657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67656‎ | r67657 | r67658 >
Date:18:31, 8 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: Add browser detection for PS3 and blacklist it from CollapsibleNav
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.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.browser.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js
@@ -14,7 +14,8 @@
1515 'konqueror': [['>=', 4.0]],
1616 'blackberry': false,
1717 'ipod': false,
18 - 'iphone': false
 18+ 'iphone': false,
 19+ 'ps3': false
1920 },
2021 // Right-to-left languages
2122 'rtl': {
@@ -22,7 +23,8 @@
2324 'konqueror': [['>=', 4.0]],
2425 'blackberry': false,
2526 'ipod': false,
26 - 'iphone': false
 27+ 'iphone': false,
 28+ 'ps3': false
2729 }
2830 }
2931 };
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -12,7 +12,7 @@
1313
1414 static $scripts = array(
1515 'raw' => array(
16 - array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 19 ),
 16+ array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 20 ),
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ),
1818 array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 3 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ),
@@ -20,10 +20,10 @@
2121 array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 15 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 42 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 43 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 42 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 43 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -14,7 +14,8 @@
1515 'konqueror': [['>=', 4.0]],
1616 'blackberry': false,
1717 'ipod': false,
18 - 'iphone': false
 18+ 'iphone': false,
 19+ 'ps3': false
1920 },
2021 // Right-to-left languages
2122 'rtl': {
@@ -22,7 +23,8 @@
2324 'konqueror': [['>=', 4.0]],
2425 'blackberry': false,
2526 'ipod': false,
26 - 'iphone': false
 27+ 'iphone': false,
 28+ 'ps3': false
2729 }
2830 }
2931 };
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -1,6 +1,6 @@
22
33 $j(document).ready(function(){if(!wgVectorEnabledModules.collapsiblenav){return true;}
4 -var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
 4+var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false},'rtl':{'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
55 var version=1;if(wgCollapsibleNavForceNewVersion==true){version=2;}else{if(wgCollapsibleNavBucketTest==true){version=$j.cookie('vector-nav-pref-version');if(version==null){console.log(version);version=Math.round(Math.random()+1);$j.cookie('vector-nav-pref-version',version,{'expires':30,'path':'/'});}}}
66 if(version==2){var limit=5;var threshold=3;$j('#p-lang ul').addClass('secondary').before('<ul class="primary"></ul>');var languages=['en','fr','de','es','pt','it','ru','ja','nl','pl','zh','sv','ar','tr','uk','fi','no','ca','ro','hu','ksh','id','he','cs','vi','ko','sr','fa','da','eo','sk','th','lt','vo','bg','sl','hr','hi','et','mk','simple','new','ms','nn','gl','el','eu','ka','tl','bn','lv','ml','bs','te','la','az','sh','war','br','is','mr','be-x-old','sq','cy','lb','ta','zh-classical','an','jv','ht','oc','bpy','ceb','ur','zh-yue','pms','scn','be','roa-rup','qu','af','sw','nds','fy','lmo','wa','ku','hy','su','yi','io','os','ga','ast','nap','vec','gu','cv','bat-smg','kn','uz','zh-min-nan','si','als','yo','li','gan','arz','sah','tt','bar','gd','tg','kk','pam','hsb','roa-tara','nah','mn','vls','gv','mi','am','ia','co','ne','fo','nds-nl','glk','mt','ang','wuu','dv','km','sco','bcl','mg','my','diq','tk','szl','ug','fiu-vro','sc','rm','nrm','ps','nv','hif','bo','se','sa','pnb','map-bms','lad','lij','crh','fur','kw','to','pa','jbo','ba','ilo','csb','wo','xal','krc','ckb','pag','ln','frp','mzn','ce','nov','kv','eml','gn','ky','pdc','lo','haw','mhr','dsb','stq','tpi','arc','hak','ie','so','bh','ext','mwl','sd','ig','myv','ay','iu','na','cu','pi','kl','ty','lbe','ab','got','sm','as','mo','ee','zea','av','ace','kg','bm','cdo','cbk-zam','kab','om','chr','pap','udm','ks','zu','rmy','cr','ch','st','ik','mdf','kaa','aa','fj','srn','tet','or','pnt','bug','ss','ts','pcd','pih','za','sg','lg','bxr','xh','ak','ha','bi','ve','tn','ff','dz','ti','ki','ny','rw','chy','tw','sn','tum','ng','rn','mh','ii','cho','hz','kr','ho','mus','kj'];var acceptLangCookie=$j.cookie('accept-language');if(acceptLangCookie!=null){if(acceptLangCookie!=''){languages=acceptLangCookie.split(',').concat(languages);}}else{$j.getJSON(wgScriptPath+'/api.php?action=query&meta=userinfo&uiprop=acceptlang&format=json',function(data){var langs=[];if(typeof data.query!='undefined'&&typeof data.query.userinfo!='undefined'&&typeof data.query.userinfo.acceptlang!='undefined'){for(var j=0;j<data.query.userinfo.acceptlang.length;j++){if(data.query.userinfo.acceptlang[j].q!=0){langs.push(data.query.userinfo.acceptlang[j]['*']);}}}
77 $j.cookie('accept-language',langs.join(','),{'path':'/','expires':30});});}
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -66,7 +66,7 @@
6767 // Core functionality of extension scripts
6868 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
6969 array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 11 ),
70 - array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 7 ),
 70+ array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 8 ),
7171 array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 6 ),
7272 array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ),
7373 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
@@ -89,10 +89,10 @@
9090 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 1 ),
9191 ),
9292 'combined' => array(
93 - array( 'src' => 'js/plugins.combined.js', 'version' => 417 ),
 93+ array( 'src' => 'js/plugins.combined.js', 'version' => 418 ),
9494 ),
9595 'minified' => array(
96 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 417 ),
 96+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 418 ),
9797 ),
9898 ),
9999 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.browser.js
@@ -56,15 +56,16 @@
5757 return r;
5858 };
5959
60 - a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome/) ? m(a, [
 60+ a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome|PLAYSTATION 3/) ? m(a, [
6161 [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''],
6262 ['Chrome Safari', 'Chrome'],
6363 ['KHTML', 'Konqueror'],
6464 ['Minefield', 'Firefox'],
65 - ['Navigator', 'Netscape']
 65+ ['Navigator', 'Netscape'],
 66+ ['PLAYSTATION 3', 'PS3']
6667 ]) : a).toLowerCase();
6768
68 - $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\)|\s|$)/));
 69+ $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry|ps3)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari|ps3)(\/|\;?\s|)([a-z0-9\.\+]*?)(\;|dev|rel|\)|\s|$)/));
6970
7071 $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [
7172 ['konqueror', 'khtml'],
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5327,15 +5327,16 @@
53285328 return r;
53295329 };
53305330
5331 - a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome/) ? m(a, [
 5331+ a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome|PLAYSTATION 3/) ? m(a, [
53325332 [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''],
53335333 ['Chrome Safari', 'Chrome'],
53345334 ['KHTML', 'Konqueror'],
53355335 ['Minefield', 'Firefox'],
5336 - ['Navigator', 'Netscape']
 5336+ ['Navigator', 'Netscape'],
 5337+ ['PLAYSTATION 3', 'PS3']
53375338 ]) : a).toLowerCase();
53385339
5339 - $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\)|\s|$)/));
 5340+ $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry|ps3)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari|ps3)(\/|\;?\s|)([a-z0-9\.\+]*?)(\;|dev|rel|\)|\s|$)/));
53405341
53415342 $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [
53425343 ['konqueror', 'khtml'],
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -372,7 +372,7 @@
373373 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';}
374374 if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}
375375 if(r.name==='opera'&&$.browser.version>=9.8){r.version=i.match(/version\/([0-9\.]*)/i)[1]||10;}
376 -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|ipod|iphone|blackberry)/,[],/(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(){$.collapsibleTabs.addData($(this));});});if(!$.collapsibleTabs.boundEvent){$(window).delayedBind('500','resize',function(){$.collapsibleTabs.handleResize();});}
 376+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|PLAYSTATION 3/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape'],['PLAYSTATION 3','PS3']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry|ps3)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari|ps3)(\/|\;?\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(){$.collapsibleTabs.addData($(this));});});if(!$.collapsibleTabs.boundEvent){$(window).delayedBind('500','resize',function(){$.collapsibleTabs.handleResize();});}
377377 $.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())<($('#right-navigation').position().left-eleWidth);},collapseCondition:function(){return($('#left-navigation').position().left+$('#left-navigation').width())>$('#right-navigation').position().left;}},addData:function($collapsible){var $settings=$collapsible.parent().data('collapsibleTabsSettings');$collapsible.data('collapsibleTabsSettings',{'expandedContainer':$settings.expandedContainer,'collapsedContainer':$settings.collapsedContainer,'expandedWidth':$collapsible.width(),'prevElement':$collapsible.prev()});},getSettings:function($collapsible){var $settings=$collapsible.data('collapsibleTabsSettings');if(typeof $settings=='undefined'){$.collapsibleTabs.addData($collapsible);$settings=$collapsible.data('collapsibleTabsSettings');}
378378 return $settings;},handleResize:function(e){$.collapsibleTabs.instances.each(function(){var $this=$(this),data=$.collapsibleTabs.getSettings($this);if(data.shifting)return;if($this.children(data.collapsible).length>0&&data.collapseCondition()){$this.trigger("beforeTabCollapse");$.collapsibleTabs.moveToCollapsed($this.children(data.collapsible+':last'));}
379379 if($(data.collapsedContainer+' '+data.collapsible).length>0&&data.expandCondition($.collapsibleTabs.getSettings($(data.collapsedContainer).children(data.collapsible+":first")).expandedWidth)){$this.trigger("beforeTabExpand");$.collapsibleTabs.moveToExpanded(data.collapsedContainer+" "+data.collapsible+':first');}});},moveToCollapsed:function(ele){var $moving=$(ele);var data=$.collapsibleTabs.getSettings($moving);var dataExp=$.collapsibleTabs.getSettings(data.expandedContainer);dataExp.shifting=true;$moving.remove().prependTo(data.collapsedContainer).data('collapsibleTabsSettings',data);dataExp.shifting=false;$.collapsibleTabs.handleResize();},moveToExpanded:function(ele){var $moving=$(ele);var data=$.collapsibleTabs.getSettings($moving);var dataExp=$.collapsibleTabs.getSettings(data.expandedContainer);dataExp.shifting=true;$moving.remove().insertAfter(data.prevElement).data('collapsibleTabsSettings',data);dataExp.shifting=false;$.collapsibleTabs.handleResize();}};})(jQuery);(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}

Status & tagging log