r63778 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63777‎ | r63778 | r63779 >
Date:19:30, 15 March 2010
Author:catrope
Status:deferred (Comments)
Tags:
Comment:
UsabilityInitiative: Blacklist Opera for search&replace dialog (bug 22816), blacklist iPod (bug 22524, bug 22839, bug 22840), iPhone and BlackBerry (bug 22526) for everything. Modifies browser plugin to add support for iPod, iPhone and BlackBerry.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.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)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -65,14 +65,14 @@
6666 // Core functionality of extension scripts
6767 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
6868 array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 7 ),
69 - array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 5 ),
 69+ array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 6 ),
7070 array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 5 ),
7171 array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ),
7272 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
7373 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 168 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 169 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 43 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 52 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 21 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 333 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 334 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 333 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 334 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -16,14 +16,14 @@
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 55 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 56 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 59 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 60 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 59 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 60 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1638,27 +1638,25 @@
16391639 }
16401640 },
16411641 'search-and-replace': {
1642 - /*
16431642 'browsers': {
16441643 // Left-to-right languages
16451644 'ltr': {
16461645 'msie': [['>=', 7]],
1647 - 'firefox': [['>=', 3]],
1648 - 'opera': [['>=', 10]],
1649 - 'safari': [['>=', 4]],
1650 - 'chrome': [['>=', 4]]
 1646+ 'firefox': [['>=', 2]],
 1647+ 'opera': [['&&', false]], // blacklisted
 1648+ 'safari': [['>=', 3]],
 1649+ 'chrome': [['>=', 3]]
16511650 },
16521651 // Right-to-left languages
16531652 'rtl': {
16541653 'msie': [['>=', 8]],
1655 - 'firefox': [['>=', 3]],
1656 - 'opera': [['>=', 10]],
1657 - 'safari': [['>=', 4]],
1658 - 'chrome': [['>=', 4]]
 1654+ 'firefox': [['>=', 2]],
 1655+ 'opera': ['&&', false], // blacklisted
 1656+ 'safari': [['>=', 3]],
 1657+ 'chrome': [['>=', 3]]
16591658 }
16601659 },
16611660 'req': [ 'iframe' ],
1662 - */
16631661 filters: [ '#wpTextbox1.toolbar-dialogs' ],
16641662 titleMsg: 'wikieditor-toolbar-tool-replace-title',
16651663 id: 'wikieditor-toolbar-replace-dialog',
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -142,7 +142,7 @@
143143 classes.push('sortable');var classStr=classes.length>0?' class="'+classes.join(' ')+'"':'';$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:'{|'+classStr+"\n",peri:table,post:'|}',ownline:true}},$j(this));$j('#wikieditor-toolbar-table-dimensions-rows').val(4);$j('#wikieditor-toolbar-table-dimensions-columns').val(3);if(!$j('#wikieditor-toolbar-table-dimensions-header').is(':checked'))
144144 $j('#wikieditor-toolbar-table-dimensions-header').click();if(!$j('#wikieditor-toolbar-table-wikitable').is(':checked'))
145145 $j('#wikieditor-toolbar-table-wikitable').click();if($j('#wikieditor-toolbar-table-sortable').is(':checked'))
146 -$j('#wikieditor-toolbar-table-sortable').click();$j(this).dialog('close');},'wikieditor-toolbar-tool-table-cancel':function(){$j(this).dialog('close');}},open:function(){$j('#wikieditor-toolbar-table-dimensions-rows').focus();if(!($j(this).data('dialogkeypressset'))){$j(this).data('dialogkeypressset',true);$j(this).closest('.ui-dialog').keypress(function(e){if((e.keyCode||e.which)==13){var button=$j(this).data('dialogaction')||$j(this).find('button:first');button.click();e.preventDefault();}});$j(this).closest('.ui-dialog').find('button').focus(function(){$j(this).closest('.ui-dialog').data('dialogaction',this);});}}}},'search-and-replace':{filters:['#wpTextbox1.toolbar-dialogs'],titleMsg:'wikieditor-toolbar-tool-replace-title',id:'wikieditor-toolbar-replace-dialog',html:'\
 146+$j('#wikieditor-toolbar-table-sortable').click();$j(this).dialog('close');},'wikieditor-toolbar-tool-table-cancel':function(){$j(this).dialog('close');}},open:function(){$j('#wikieditor-toolbar-table-dimensions-rows').focus();if(!($j(this).data('dialogkeypressset'))){$j(this).data('dialogkeypressset',true);$j(this).closest('.ui-dialog').keypress(function(e){if((e.keyCode||e.which)==13){var button=$j(this).data('dialogaction')||$j(this).find('button:first');button.click();e.preventDefault();}});$j(this).closest('.ui-dialog').find('button').focus(function(){$j(this).closest('.ui-dialog').data('dialogaction',this);});}}}},'search-and-replace':{'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2]],'opera':[['&&',false]],'safari':[['>=',3]],'chrome':[['>=',3]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2]],'opera':['&&',false],'safari':[['>=',3]],'chrome':[['>=',3]]}},'req':['iframe'],filters:['#wpTextbox1.toolbar-dialogs'],titleMsg:'wikieditor-toolbar-tool-replace-title',id:'wikieditor-toolbar-replace-dialog',html:'\
147147 <div id="wikieditor-toolbar-replace-message">\
148148 <div id="wikieditor-toolbar-replace-nomatch" rel="wikieditor-toolbar-tool-replace-nomatch"></div>\
149149 <div id="wikieditor-toolbar-replace-success"></div>\
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1589,27 +1589,25 @@
15901590 }
15911591 },
15921592 'search-and-replace': {
1593 - /*
15941593 'browsers': {
15951594 // Left-to-right languages
15961595 'ltr': {
15971596 'msie': [['>=', 7]],
1598 - 'firefox': [['>=', 3]],
1599 - 'opera': [['>=', 10]],
1600 - 'safari': [['>=', 4]],
1601 - 'chrome': [['>=', 4]]
 1597+ 'firefox': [['>=', 2]],
 1598+ 'opera': [['&&', false]], // blacklisted
 1599+ 'safari': [['>=', 3]],
 1600+ 'chrome': [['>=', 3]]
16021601 },
16031602 // Right-to-left languages
16041603 'rtl': {
16051604 'msie': [['>=', 8]],
1606 - 'firefox': [['>=', 3]],
1607 - 'opera': [['>=', 10]],
1608 - 'safari': [['>=', 4]],
1609 - 'chrome': [['>=', 4]]
 1605+ 'firefox': [['>=', 2]],
 1606+ 'opera': ['&&', false], // blacklisted
 1607+ 'safari': [['>=', 3]],
 1608+ 'chrome': [['>=', 3]]
16101609 }
16111610 },
16121611 'req': [ 'iframe' ],
1613 - */
16141612 filters: [ '#wpTextbox1.toolbar-dialogs' ],
16151613 titleMsg: 'wikieditor-toolbar-tool-replace-title',
16161614 id: 'wikieditor-toolbar-replace-dialog',
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -44,7 +44,10 @@
4545 'opera': [['>=', 9.6]],
4646 // jQuery minimums
4747 'safari': [['>=', 3]],
48 - 'chrome': [['>=', 3]]
 48+ 'chrome': [['>=', 3]],
 49+ 'blackberry': [['&&', false]], // blacklisted
 50+ 'ipod': [['&&', false]], // blacklisted
 51+ 'iphone': [['&&', false]] // blacklisted
4952 },
5053 // Right-to-left languages
5154 'rtl': {
@@ -56,7 +59,10 @@
5760 'opera': [['>=', 9.6]],
5861 // jQuery minimums
5962 'safari': [['>=', 3]],
60 - 'chrome': [['>=', 3]]
 63+ 'chrome': [['>=', 3]],
 64+ 'blackberry': [['&&', false]], // blacklisted
 65+ 'ipod': [['&&', false]], // blacklisted
 66+ 'iphone': [['&&', false]] // blacklisted
6167 }
6268 },
6369 /**
@@ -531,7 +537,7 @@
532538 name in $.wikiEditor.modules[module].evt
533539 ) {
534540 var ret = $.wikiEditor.modules[module].evt[name]( context, event );
535 - if(ret != null){
 541+ if (ret != null) {
536542 //if 1 returns false, the end result is false
537543 if( returnFromModules == null ) {
538544 returnFromModules = ret;
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.browser.js
@@ -64,7 +64,7 @@
6565 ['Navigator', 'Netscape']
6666 ]) : a).toLowerCase();
6767
68 - $.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|$)/));
 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|$)/));
6969
7070 $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [
7171 ['konqueror', 'khtml'],
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5326,7 +5326,7 @@
53275327 ['Navigator', 'Netscape']
53285328 ]) : a).toLowerCase();
53295329
5330 - $.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|$)/));
 5330+ $.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|$)/));
53315331
53325332 $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [
53335333 ['konqueror', 'khtml'],
@@ -6587,7 +6587,10 @@
65886588 'opera': [['>=', 9.6]],
65896589 // jQuery minimums
65906590 'safari': [['>=', 3]],
6591 - 'chrome': [['>=', 3]]
 6591+ 'chrome': [['>=', 3]],
 6592+ 'blackberry': [['&&', false]], // blacklisted
 6593+ 'ipod': [['&&', false]], // blacklisted
 6594+ 'iphone': [['&&', false]] // blacklisted
65926595 },
65936596 // Right-to-left languages
65946597 'rtl': {
@@ -6599,7 +6602,10 @@
66006603 'opera': [['>=', 9.6]],
66016604 // jQuery minimums
66026605 'safari': [['>=', 3]],
6603 - 'chrome': [['>=', 3]]
 6606+ 'chrome': [['>=', 3]],
 6607+ 'blackberry': [['&&', false]], // blacklisted
 6608+ 'ipod': [['&&', false]], // blacklisted
 6609+ 'iphone': [['&&', false]] // blacklisted
66046610 }
66056611 },
66066612 /**
@@ -7074,7 +7080,7 @@
70757081 name in $.wikiEditor.modules[module].evt
70767082 ) {
70777083 var ret = $.wikiEditor.modules[module].evt[name]( context, event );
7078 - if(ret != null){
 7084+ if (ret != null) {
70797085 //if 1 returns false, the end result is false
70807086 if( returnFromModules == null ) {
70817087 returnFromModules = ret;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -371,7 +371,7 @@
372372 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';}
373373 if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}
374374 if(r.name==='opera'&&$.browser.version>=9.8){r.version=i.match(/version\/([0-9\.]*)/i)[1]||10;}
375 -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();});}
 375+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(){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();});}
376376 $.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;}},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'));}
377377 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);(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);}
378378 fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
@@ -443,7 +443,7 @@
444444 options.endContainer=options.startContainer;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;}
445445 var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;var needSave=false;if(hasIframe&&context.savedSelection!==null){context.fn.restoreSelection();needSave=true;}
446446 retval=(hasIframe?context.fn:fn)[command].call(this,options);if(hasIframe&&needSave){context.fn.saveSelection();}
447 -return retval;};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(module){var mod=module&&'browsers'in module?module:$.wikiEditor;if(typeof mod.supported!=='undefined'){return mod.supported;}
 447+return retval;};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]],'blackberry':[['&&',false]],'ipod':[['&&',false]],'iphone':[['&&',false]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]],'blackberry':[['&&',false]],'ipod':[['&&',false]],'iphone':[['&&',false]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(module){var mod=module&&'browsers'in module?module:$.wikiEditor;if(typeof mod.supported!=='undefined'){return mod.supported;}
448448 if(!($.browser.name in mod.browsers[$('body').is('.rtl')?'rtl':'ltr'])){return mod.supported=true;}
449449 var browser=mod.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(var condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return mod.supported=false;}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return mod.supported=false;}}}
450450 return mod.supported=true;},'isRequired':function(module,requirement){if(typeof module['req']!=='undefined'){for(req in module['req']){if(module['req'][req]==requirement){return true;}}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r63781UsabilityInitiative: Fix r63778: false doesn't work for blacklistingcatrope20:26, 15 March 2010

Comments

#Comment by Simetrical (talk | contribs)   18:11, 16 March 2010

Could you use some kind of feature-based blacklisting here in case Opera fixes the bug in a future release? Like a simple test to check if the bug is present, and blacklist if so? Blacklisting all versions of Opera forever means that it will never work even if fixed in Opera. Since code tends to stick around for a long time, it's more likely than not that the Opera bug will be fixed before this code is retired.

#Comment by Catrope (talk | contribs)   18:24, 16 March 2010

You're right that we should use feature detection. In fact, I know how to detect this bug and even how to work around it, but we're on a tight schedule so we don't have time to support this relatively obscure browser-feature combo right now. I'll revisit this in a few weeks or so.

Also note that detecting this bug is non-trivial and slow: it requires creating an invisible textarea, moving the selection, inserting text, then grabbing the selection text. For background on this bug (a stupid CRLF vs. LF inconsistency), see here.

Status & tagging log