r67742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67741‎ | r67742 | r67743 >
Date:18:47, 9 June 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Moved functionality for testing browser compatability and finding the highest tabindex in use on a page to the mw.usability object to avoid the Vector extension accessing functionality from (and thus depending on) the WikiEditor extension.
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.wikiEditor.dialogs.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/usability.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js
@@ -2,35 +2,41 @@
33 /* First draft and will be changing greatly */
44
55 $j(document).ready( function() {
6 - if( !wgVectorEnabledModules.collapsiblenav ) {
 6+ if ( !wgVectorEnabledModules.collapsiblenav ) {
77 return true;
88 }
9 - var mod = {
10 - 'browsers': {
11 - // Left-to-right languages
12 - 'ltr': {
13 - // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
14 - 'opera': [['>=', 9.6]],
15 - 'konqueror': [['>=', 4.0]],
16 - 'blackberry': false,
17 - 'ipod': false,
18 - 'iphone': false,
19 - 'ps3': false
20 - },
21 - // Right-to-left languages
22 - 'rtl': {
23 - 'opera': [['>=', 9.6]],
24 - 'konqueror': [['>=', 4.0]],
25 - 'blackberry': false,
26 - 'ipod': false,
27 - 'iphone': false,
28 - 'ps3': false
29 - }
 9+
 10+ /* Browser Support */
 11+
 12+ var map = {
 13+ // Left-to-right languages
 14+ 'ltr': {
 15+ // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
 16+ 'msie': [['>=', 7]],
 17+ 'opera': [['>=', 9.6]],
 18+ 'konqueror': [['>=', 4.0]],
 19+ 'blackberry': false,
 20+ 'ipod': false,
 21+ 'iphone': false,
 22+ 'ps3': false
 23+ },
 24+ // Right-to-left languages
 25+ 'rtl': {
 26+ 'msie': [['>=', 7]],
 27+ 'opera': [['>=', 9.6]],
 28+ 'konqueror': [['>=', 4.0]],
 29+ 'blackberry': false,
 30+ 'ipod': false,
 31+ 'iphone': false,
 32+ 'ps3': false
3033 }
3134 };
32 - if ( !$j.wikiEditor.isSupported( mod ) ) {
 35+ if ( !mw.usability.testBrowser( map ) ) {
3336 return true;
3437 }
 38+
 39+ /* Bucket Testing */
 40+
3541 // Fallback to old version
3642 var version = 1;
3743 // Allow new version override
@@ -49,6 +55,9 @@
5056 }
5157 }
5258 }
 59+
 60+ /* Special Language Portal Handling */
 61+
5362 // Language portal splitting feature (if it's turned on)
5463 if ( version == 2 ) {
5564 // How many links to show in the primary languages portal
@@ -142,6 +151,9 @@
143152 // Always show the primary interwiki language portal
144153 $j( '#p-lang' ).addClass( 'persistent' );
145154 }
 155+
 156+ /* General Portal Modification */
 157+ debugger;
146158 // Always show the first portal
147159 $j( '#mw-panel > div.portal:first' ).addClass( 'first persistent' );
148160 // Apply a class to the entire panel to activate styles
@@ -179,23 +191,18 @@
180192 .find( 'div.body' )
181193 .slideToggle( 'fast' );
182194 }
 195+
 196+ /* Tab Indexing */
 197+
183198 var $headings = $j( '#mw-panel > div.portal:not(.persistent) > h5' );
184 - /** Copy-pasted from jquery.wikiEditor.dialogs - :( */
185 - // Find the highest tabindex in use
186 - var maxTI = 0;
187 - $j( '[tabindex]' ).each( function() {
188 - var ti = parseInt( $j(this).attr( 'tabindex' ) );
189 - if ( ti > maxTI )
190 - maxTI = ti;
191 - });
192 - var tabIndex = maxTI + 1;
 199+ // Get the highest tab index
 200+ var tabIndex = mw.usability.getMaxTabIndex() + 1;
193201 // Fix the search not having a tabindex
194202 $j( '#searchInput' ).attr( 'tabindex', tabIndex++ );
195203 // Make it keyboard accessible
196204 $headings.each( function() {
197205 $j(this).attr( 'tabindex', tabIndex++ );
198206 } );
199 - /** End of copy-pasted section */
200207 // Toggle the selected menu's class and expand or collapse the menu
201208 $headings
202209 // Make the space and enter keys act as a click
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' => 23 ),
 16+ array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 24 ),
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' => 47 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 48 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 47 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 48 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -2,35 +2,41 @@
33 /* First draft and will be changing greatly */
44
55 $j(document).ready( function() {
6 - if( !wgVectorEnabledModules.collapsiblenav ) {
 6+ if ( !wgVectorEnabledModules.collapsiblenav ) {
77 return true;
88 }
9 - var mod = {
10 - 'browsers': {
11 - // Left-to-right languages
12 - 'ltr': {
13 - // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
14 - 'opera': [['>=', 9.6]],
15 - 'konqueror': [['>=', 4.0]],
16 - 'blackberry': false,
17 - 'ipod': false,
18 - 'iphone': false,
19 - 'ps3': false
20 - },
21 - // Right-to-left languages
22 - 'rtl': {
23 - 'opera': [['>=', 9.6]],
24 - 'konqueror': [['>=', 4.0]],
25 - 'blackberry': false,
26 - 'ipod': false,
27 - 'iphone': false,
28 - 'ps3': false
29 - }
 9+
 10+ /* Browser Support */
 11+
 12+ var map = {
 13+ // Left-to-right languages
 14+ 'ltr': {
 15+ // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
 16+ 'msie': [['>=', 7]],
 17+ 'opera': [['>=', 9.6]],
 18+ 'konqueror': [['>=', 4.0]],
 19+ 'blackberry': false,
 20+ 'ipod': false,
 21+ 'iphone': false,
 22+ 'ps3': false
 23+ },
 24+ // Right-to-left languages
 25+ 'rtl': {
 26+ 'msie': [['>=', 7]],
 27+ 'opera': [['>=', 9.6]],
 28+ 'konqueror': [['>=', 4.0]],
 29+ 'blackberry': false,
 30+ 'ipod': false,
 31+ 'iphone': false,
 32+ 'ps3': false
3033 }
3134 };
32 - if ( !$j.wikiEditor.isSupported( mod ) ) {
 35+ if ( !mw.usability.testBrowser( map ) ) {
3336 return true;
3437 }
 38+
 39+ /* Bucket Testing */
 40+
3541 // Fallback to old version
3642 var version = 1;
3743 // Allow new version override
@@ -49,6 +55,9 @@
5056 }
5157 }
5258 }
 59+
 60+ /* Special Language Portal Handling */
 61+
5362 // Language portal splitting feature (if it's turned on)
5463 if ( version == 2 ) {
5564 // How many links to show in the primary languages portal
@@ -142,6 +151,9 @@
143152 // Always show the primary interwiki language portal
144153 $j( '#p-lang' ).addClass( 'persistent' );
145154 }
 155+
 156+ /* General Portal Modification */
 157+ debugger;
146158 // Always show the first portal
147159 $j( '#mw-panel > div.portal:first' ).addClass( 'first persistent' );
148160 // Apply a class to the entire panel to activate styles
@@ -179,23 +191,18 @@
180192 .find( 'div.body' )
181193 .slideToggle( 'fast' );
182194 }
 195+
 196+ /* Tab Indexing */
 197+
183198 var $headings = $j( '#mw-panel > div.portal:not(.persistent) > h5' );
184 - /** Copy-pasted from jquery.wikiEditor.dialogs - :( */
185 - // Find the highest tabindex in use
186 - var maxTI = 0;
187 - $j( '[tabindex]' ).each( function() {
188 - var ti = parseInt( $j(this).attr( 'tabindex' ) );
189 - if ( ti > maxTI )
190 - maxTI = ti;
191 - });
192 - var tabIndex = maxTI + 1;
 199+ // Get the highest tab index
 200+ var tabIndex = mw.usability.getMaxTabIndex() + 1;
193201 // Fix the search not having a tabindex
194202 $j( '#searchInput' ).attr( 'tabindex', tabIndex++ );
195203 // Make it keyboard accessible
196204 $headings.each( function() {
197205 $j(this).attr( 'tabindex', tabIndex++ );
198206 } );
199 - /** End of copy-pasted section */
200207 // Toggle the selected menu's class and expand or collapse the menu
201208 $headings
202209 // Make the space and enter keys act as a click
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,'ps3':false},'rtl':{'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
 4+var map={'ltr':{'msie':[['>=',7]],'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false},'rtl':{'msie':[['>=',7]],'opera':[['>=',9.6]],'konqueror':[['>=',4.0]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false}};if(!mw.usability.testBrowser(map)){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){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});});}
@@ -9,10 +9,9 @@
1010 if(count<limit){$secondary.children().each(function(){if(count++<limit){$j(this).appendTo($primary);}else{return false;}});}
1111 if($secondary.children().length==0){$secondary.remove();}else{$j('#p-lang').after('<div id="p-lang-more" class="portal"><h5></h5><div class="body"></div></div>');$j('#p-lang-more h5').text(mw.usability.getMsg('vector-collapsiblenav-more'));$secondary.appendTo($j('#p-lang-more div.body'));}
1212 $j('#p-lang').addClass('persistent');}
13 -$j('#mw-panel > div.portal:first').addClass('first persistent');$j('#mw-panel').addClass('collapsible-nav');$j('#mw-panel > div.portal:not(.persistent)').each(function(i){var id=$j(this).attr('id');var state=$j.cookie('vector-nav-'+id);if(state=='true'||(state==null&&i<1)||version==1&&id=='p-lang'){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}
 13+debugger;$j('#mw-panel > div.portal:first').addClass('first persistent');$j('#mw-panel').addClass('collapsible-nav');$j('#mw-panel > div.portal:not(.persistent)').each(function(i){var id=$j(this).attr('id');var state=$j.cookie('vector-nav-'+id);if(state=='true'||(state==null&&i<1)||version==1&&id=='p-lang'){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}
1414 if(state!=null){$j.cookie('vector-nav-'+$j(this).attr('id'),state,{'expires':30,'path':'/'});}});function toggle($element){$j.cookie('vector-nav-'+$element.parent().attr('id'),$element.parent().is('.collapsed'),{'expires':30,'path':'/'});$element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');}
15 -var $headings=$j('#mw-panel > div.portal:not(.persistent) > h5');var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI)
16 -maxTI=ti;});var tabIndex=maxTI+1;$j('#searchInput').attr('tabindex',tabIndex++);$headings.each(function(){$j(this).attr('tabindex',tabIndex++);});$headings.keydown(function(event){if(event.which==13||event.which==32){toggle($j(this));}}).mousedown(function(){toggle($j(this));$j(this).blur();return false;});});$j(document).ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;}
 15+var $headings=$j('#mw-panel > div.portal:not(.persistent) > h5');var tabIndex=mw.usability.getMaxTabIndex()+1;$j('#searchInput').attr('tabindex',tabIndex++);$headings.each(function(){$j(this).attr('tabindex',tabIndex++);});$headings.keydown(function(event){if(event.which==13||event.which==32){toggle($j(this));}}).mousedown(function(){toggle($j(this));$j(this).blur();return false;});});$j(document).ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;}
1716 var rtl=$j('body').is('.rtl');$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var target=data.collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0).animate({width:'1px'},"normal",function(){$j(this).hide();$j('<span class="placeholder" style="display:none;"></span>').insertAfter(this);$j(this).remove().prependTo(target).data('collapsibleTabsSettings',data);$j(this).attr('style','display:list-item;');$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($j(ele)).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var $target=$j(data.expandedContainer).find('span.placeholder:first');var expandedWidth=data.expandedWidth;$moving.css("position","relative").css((rtl?'right':'left'),0).css('width','1px');$target.replaceWith($moving.remove().css('width','1px').data('collapsibleTabsSettings',data).animate({width:expandedWidth+"px"},"normal",function(){$j(this).attr('style','display:block;');$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none')
1817 $j("#p-cactions").addClass("filledPortlet").removeClass("emptyPortlet").find('h5').css('width','1px').animate({'width':'26px'},390);}).bind("beforeTabExpand",function(){if($j('#p-cactions li').length==1)
1918 $j("#p-cactions h5").animate({'width':'1px'},370,function(){$j(this).attr('style','').parent().addClass("emptyPortlet").removeClass("filledPortlet");});}).collapsibleTabs({expandCondition:function(eleWidth){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width()+1)<($j('#left-navigation').position().left-eleWidth);}else{return($j('#left-navigation').position().left+$j('#left-navigation').width()+1)<($j('#right-navigation').position().left-eleWidth);}},collapseCondition:function(){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width())>$j('#left-navigation').position().left;}else{return($j('#left-navigation').position().left+$j('#left-navigation').width())>$j('#right-navigation').position().left;}}});});$j(document).ready(function(){if(!wgVectorEnabledModules.editwarning||$j('#wpTextbox1').size()==0){return true;}
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -53,7 +53,7 @@
5454 'base_sets' => array(
5555 'raw' => array(
5656 // Common UsabilityInitiative funtions
57 - array( 'src' => 'js/usability.js', 'version' => 1 ),
 57+ array( 'src' => 'js/usability.js', 'version' => 2 ),
5858
5959 // These scripts can be pulled from core once the js2 is merged
6060 array( 'src' => 'js/js2stopgap/ui.core.js', 'version' => 1 ),
@@ -75,10 +75,10 @@
7676 array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 16 ),
7777 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 21 ),
7878 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 35 ),
79 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 192 ),
 79+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 193 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 66 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 25 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 26 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
8484 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
8585 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 77 ),
@@ -89,10 +89,10 @@
9090 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 2 ),
9191 ),
9292 'combined' => array(
93 - array( 'src' => 'js/plugins.combined.js', 'version' => 421 ),
 93+ array( 'src' => 'js/plugins.combined.js', 'version' => 422 ),
9494 ),
9595 'minified' => array(
96 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 421 ),
 96+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 422 ),
9797 ),
9898 ),
9999 );
Index: trunk/extensions/UsabilityInitiative/js/usability.js
@@ -5,18 +5,18 @@
66 if ( typeof mw == 'undefined' ) {
77 mw = {};
88 }
9 -
 9+/**
 10+ * Base object for Usability Initiative functionality - naming is temporary
 11+ */
1012 mw.usability = {
11 - messages: {}
 13+ 'messages': {}
1214 }
13 -
1415 /**
1516 * This may eventually load something instead of just calling the callback.
1617 */
1718 mw.usability.load = function( deps, callback ) {
1819 callback();
1920 };
20 -
2121 /**
2222 * Add messages to a local message table
2323 */
@@ -25,7 +25,6 @@
2626 this.messages[key] = messages[key];
2727 }
2828 };
29 -
3029 /**
3130 * Get a message
3231 */
@@ -43,3 +42,76 @@
4443 }
4544 return msg;
4645 };
 46+/**
 47+ * Checks the current browser against a support map object to determine if the browser has been black-listed or not.
 48+ * Because these rules are often very complex, the object contains configurable operators and can check against
 49+ * either the browser version number or string. This process also involves checking if the current browser is amung
 50+ * those which we have configured as compatible or not. If the browser was not configured as comptible we just go on
 51+ * assuming things will work - the argument here is to prevent the need to update the code when a new browser comes
 52+ * to market. The assumption here is that any new browser will be built on an existing engine or be otherwise so
 53+ * similar to another existing browser that things actually do work as expected. The merrits of this argument, which
 54+ * is essentially to blacklist rather than whitelist are debateable, but at this point we've decided it's the more
 55+ * "open-web" way to go.
 56+ *
 57+ * This function depends on the jquery browser plugin.
 58+ *
 59+ * A browser map is in the following format:
 60+ * {
 61+ * 'ltr': {
 62+ * // Multiple rules with configurable operators
 63+ * 'msie': [['>=', 7], ['!=', 9]],
 64+ * // Blocked entirely
 65+ * 'iphone': false
 66+ * },
 67+ * 'rtl': {
 68+ * // Test against a string
 69+ * 'msie': [['!==', '8.1.2.3']],
 70+ * // RTL rules do not fall through to LTR rules, you must explicity set each of them
 71+ * 'iphone': false
 72+ * }
 73+ * }
 74+ *
 75+ * The user agent string is interpreted. Common browser names are as follows:
 76+ * 'msie', 'firefox', 'opera', 'safari', 'chrome', 'blackberry', 'ipod', 'iphone', 'ps3', 'konqueror'
 77+ *
 78+ * @param Object of browser support map
 79+ */
 80+mw.usability.testBrowser = function( map ) {
 81+ // Check over each browser condition to determine if we are running in a compatible client
 82+ var browser = map[$j( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$j.browser.name];
 83+ if ( typeof browser !== 'object' ) {
 84+ // Unknown, so we assume it's working
 85+ return true;
 86+ }
 87+ for ( var condition in browser ) {
 88+ var op = browser[condition][0];
 89+ var val = browser[condition][1];
 90+ if ( val === false ) {
 91+ return false;
 92+ } else if ( typeof val == 'string' ) {
 93+ if ( !( eval( '$j.browser.version' + op + '"' + val + '"' ) ) ) {
 94+ return false;
 95+ }
 96+ } else if ( typeof val == 'number' ) {
 97+ if ( !( eval( '$j.browser.versionNumber' + op + val ) ) ) {
 98+ return false;
 99+ }
 100+ }
 101+ }
 102+ return true;
 103+};
 104+/**
 105+ * Finds the highest tabindex in use.
 106+ *
 107+ * @return Integer of highest tabindex on the page
 108+ */
 109+mw.usability.getMaxTabIndex = function() {
 110+ var maxTI = 0;
 111+ $j( '[tabindex]' ).each( function() {
 112+ var ti = parseInt( $j(this).attr( 'tabindex' ) );
 113+ if ( ti > maxTI ) {
 114+ maxTI = ti;
 115+ }
 116+ } );
 117+ return maxTI;
 118+};
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -190,14 +190,8 @@
191191 * @param $elements Elements to set tabindexes on. If they already have tabindexes, this function can behave a bit weird
192192 */
193193 setTabindexes: function( $elements ) {
194 - // Find the highest tabindex in use
195 - var maxTI = 0;
196 - $j( '[tabindex]' ).each( function() {
197 - var ti = parseInt( $j(this).attr( 'tabindex' ) );
198 - if ( ti > maxTI )
199 - maxTI = ti;
200 - });
201 - var tabIndex = maxTI + 1;
 194+ // Get the highest tab index
 195+ var tabIndex = mw.usability.getMaxTabIndex() + 1;
202196 $elements.each( function() {
203197 $j(this).attr( 'tabindex', tabIndex++ );
204198 } );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -90,33 +90,8 @@
9191 // Cache hit
9292 return mod.supported;
9393 }
94 - // Check if we have any compatiblity information on-hand for the current browser
95 - if ( !( $.browser.name in mod.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'] ) ) {
96 - // Assume good faith :)
97 - return mod.supported = true;
98 - }
99 - // Check over each browser condition to determine if we are running in a compatible client
100 - var browser = mod.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$.browser.name];
101 - if ( typeof browser != 'object' ) {
102 - return mod.supported = false;
103 - }
104 - for ( var condition in browser ) {
105 - var op = browser[condition][0];
106 - var val = browser[condition][1];
107 - if ( val === false ) {
108 - return mod.supported = false;
109 - } else if ( typeof val == 'string' ) {
110 - if ( !( eval( '$.browser.version' + op + '"' + val + '"' ) ) ) {
111 - return mod.supported = false;
112 - }
113 - } else if ( typeof val == 'number' ) {
114 - if ( !( eval( '$.browser.versionNumber' + op + val ) ) ) {
115 - return mod.supported = false;
116 - }
117 - }
118 - }
119 - // Return and also cache the return value - this will be checked somewhat often
120 - return mod.supported = true;
 94+ // Run a browser support test and then cache and return the result
 95+ return mod.supported = mw.usability.testBrowser( mod.browsers );
12196 },
12297 /**
12398 * Checks if a module has a specific requirement
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5,18 +5,18 @@
66 if ( typeof mw == 'undefined' ) {
77 mw = {};
88 }
9 -
 9+/**
 10+ * Base object for Usability Initiative functionality - naming is temporary
 11+ */
1012 mw.usability = {
11 - messages: {}
 13+ 'messages': {}
1214 }
13 -
1415 /**
1516 * This may eventually load something instead of just calling the callback.
1617 */
1718 mw.usability.load = function( deps, callback ) {
1819 callback();
1920 };
20 -
2121 /**
2222 * Add messages to a local message table
2323 */
@@ -25,7 +25,6 @@
2626 this.messages[key] = messages[key];
2727 }
2828 };
29 -
3029 /**
3130 * Get a message
3231 */
@@ -43,6 +42,79 @@
4443 }
4544 return msg;
4645 };
 46+/**
 47+ * Checks the current browser against a support map object to determine if the browser has been black-listed or not.
 48+ * Because these rules are often very complex, the object contains configurable operators and can check against
 49+ * either the browser version number or string. This process also involves checking if the current browser is amung
 50+ * those which we have configured as compatible or not. If the browser was not configured as comptible we just go on
 51+ * assuming things will work - the argument here is to prevent the need to update the code when a new browser comes
 52+ * to market. The assumption here is that any new browser will be built on an existing engine or be otherwise so
 53+ * similar to another existing browser that things actually do work as expected. The merrits of this argument, which
 54+ * is essentially to blacklist rather than whitelist are debateable, but at this point we've decided it's the more
 55+ * "open-web" way to go.
 56+ *
 57+ * This function depends on the jquery browser plugin.
 58+ *
 59+ * A browser map is in the following format:
 60+ * {
 61+ * 'ltr': {
 62+ * // Multiple rules with configurable operators
 63+ * 'msie': [['>=', 7], ['!=', 9]],
 64+ * // Blocked entirely
 65+ * 'iphone': false
 66+ * },
 67+ * 'rtl': {
 68+ * // Test against a string
 69+ * 'msie': [['!==', '8.1.2.3']],
 70+ * // RTL rules do not fall through to LTR rules, you must explicity set each of them
 71+ * 'iphone': false
 72+ * }
 73+ * }
 74+ *
 75+ * The user agent string is interpreted. Common browser names are as follows:
 76+ * 'msie', 'firefox', 'opera', 'safari', 'chrome', 'blackberry', 'ipod', 'iphone', 'ps3', 'konqueror'
 77+ *
 78+ * @param Object of browser support map
 79+ */
 80+mw.usability.testBrowser = function( map ) {
 81+ // Check over each browser condition to determine if we are running in a compatible client
 82+ var browser = map[$j( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$j.browser.name];
 83+ if ( typeof browser !== 'object' ) {
 84+ // Unknown, so we assume it's working
 85+ return true;
 86+ }
 87+ for ( var condition in browser ) {
 88+ var op = browser[condition][0];
 89+ var val = browser[condition][1];
 90+ if ( val === false ) {
 91+ return false;
 92+ } else if ( typeof val == 'string' ) {
 93+ if ( !( eval( '$j.browser.version' + op + '"' + val + '"' ) ) ) {
 94+ return false;
 95+ }
 96+ } else if ( typeof val == 'number' ) {
 97+ if ( !( eval( '$j.browser.versionNumber' + op + val ) ) ) {
 98+ return false;
 99+ }
 100+ }
 101+ }
 102+ return true;
 103+};
 104+/**
 105+ * Finds the highest tabindex in use.
 106+ *
 107+ * @return Integer of highest tabindex on the page
 108+ */
 109+mw.usability.getMaxTabIndex = function() {
 110+ var maxTI = 0;
 111+ $j( '[tabindex]' ).each( function() {
 112+ var ti = parseInt( $j(this).attr( 'tabindex' ) );
 113+ if ( ti > maxTI ) {
 114+ maxTI = ti;
 115+ }
 116+ } );
 117+ return maxTI;
 118+};
47119 /*
48120 * jQuery UI 1.7.1
49121 *
@@ -6887,33 +6959,8 @@
68886960 // Cache hit
68896961 return mod.supported;
68906962 }
6891 - // Check if we have any compatiblity information on-hand for the current browser
6892 - if ( !( $.browser.name in mod.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'] ) ) {
6893 - // Assume good faith :)
6894 - return mod.supported = true;
6895 - }
6896 - // Check over each browser condition to determine if we are running in a compatible client
6897 - var browser = mod.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$.browser.name];
6898 - if ( typeof browser != 'object' ) {
6899 - return mod.supported = false;
6900 - }
6901 - for ( var condition in browser ) {
6902 - var op = browser[condition][0];
6903 - var val = browser[condition][1];
6904 - if ( val === false ) {
6905 - return mod.supported = false;
6906 - } else if ( typeof val == 'string' ) {
6907 - if ( !( eval( '$.browser.version' + op + '"' + val + '"' ) ) ) {
6908 - return mod.supported = false;
6909 - }
6910 - } else if ( typeof val == 'number' ) {
6911 - if ( !( eval( '$.browser.versionNumber' + op + val ) ) ) {
6912 - return mod.supported = false;
6913 - }
6914 - }
6915 - }
6916 - // Return and also cache the return value - this will be checked somewhat often
6917 - return mod.supported = true;
 6963+ // Run a browser support test and then cache and return the result
 6964+ return mod.supported = mw.usability.testBrowser( mod.browsers );
69186965 },
69196966 /**
69206967 * Checks if a module has a specific requirement
@@ -8860,14 +8907,8 @@
88618908 * @param $elements Elements to set tabindexes on. If they already have tabindexes, this function can behave a bit weird
88628909 */
88638910 setTabindexes: function( $elements ) {
8864 - // Find the highest tabindex in use
8865 - var maxTI = 0;
8866 - $j( '[tabindex]' ).each( function() {
8867 - var ti = parseInt( $j(this).attr( 'tabindex' ) );
8868 - if ( ti > maxTI )
8869 - maxTI = ti;
8870 - });
8871 - var tabIndex = maxTI + 1;
 8911+ // Get the highest tab index
 8912+ var tabIndex = mw.usability.getMaxTabIndex() + 1;
88728913 $elements.each( function() {
88738914 $j(this).attr( 'tabindex', tabIndex++ );
88748915 } );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -1,9 +1,11 @@
22
33 if(typeof mw=='undefined'){mw={};}
4 -mw.usability={messages:{}}
 4+mw.usability={'messages':{}}
55 mw.usability.load=function(deps,callback){callback();};mw.usability.addMessages=function(messages){for(var key in messages){this.messages[key]=messages[key];}};mw.usability.getMsg=function(key,args){if(!(key in this.messages)){return'['+key+']';}
66 var msg=this.messages[key];if(typeof args=='object'||typeof args=='array'){for(var argKey in args){msg=msg.replace('\$'+(parseInt(argKey)+1),args[argKey]);}}else if(typeof args=='string'||typeof args=='number'){msg=msg.replace('$1',args);}
7 -return msg;};;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.1",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
 7+return msg;};mw.usability.testBrowser=function(map){var browser=map[$j('body').is('.rtl')?'rtl':'ltr'][$j.browser.name];if(typeof browser!=='object'){return true;}
 8+for(var condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(val===false){return false;}else if(typeof val=='string'){if(!(eval('$j.browser.version'+op+'"'+val+'"'))){return false;}}else if(typeof val=='number'){if(!(eval('$j.browser.versionNumber'+op+val))){return false;}}}
 9+return true;};mw.usability.getMaxTabIndex=function(){var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI){maxTI=ti;}});return maxTI;};;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.1",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
810 for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
911 var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
1012 el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
@@ -457,10 +459,7 @@
458460 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;}
459461 retval=(hasIframe?context.fn:fn)[command].call(this,options);if(hasIframe&&needSave){context.fn.saveSelection();}
460462 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;}
461 -if(!($.browser.name in mod.browsers[$('body').is('.rtl')?'rtl':'ltr'])){return mod.supported=true;}
462 -var browser=mod.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];if(typeof browser!='object'){return mod.supported=false;}
463 -for(var condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(val===false){return mod.supported=false;}else 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;}}}
464 -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;}}}
 463+return mod.supported=mw.usability.testBrowser(mod.browsers);},'isRequired':function(module,requirement){if(typeof module['req']!=='undefined'){for(req in module['req']){if(module['req'][req]==requirement){return true;}}}
465464 return false;},'autoMsg':function(object,property){if(typeof property=='object'){for(var i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}}
466465 if(property in object){return object[property];}else if(property+'Msg'in object){if(typeof object[property+'Msg']=='object'){return mw.usability.getMsg.apply(mw.usability,object[property+'Msg']);}else{return mw.usability.getMsg(object[property+'Msg']);}}else{return'';}},'autoLang':function(object,lang){return object[lang||wgUserLanguage]||object['default']||object;},'autoIcon':function(icon,path,lang){var src=$.wikiEditor.autoLang(icon,lang);path=path||$.wikiEditor.imgPath;if(src.substr(0,7)!='http://'&&src.substr(0,8)!='https://'&&src[0]!='/'){src=path+src;}
467466 return src+'?'+wgWikiEditorIconVersion;}};$.fn.wikiEditor=function(){if(!$j.wikiEditor.isSupported()){return $(this);}
@@ -606,8 +605,7 @@
607606 context.$textarea.trigger('wikiEditor-dialogs-setup-'+mod);}}},reallyCreate:function(context,module){mw.usability.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){var configuration=module.dialog;configuration.bgiframe=true;configuration.autoOpen=false;configuration.modal=true;configuration.title=$.wikiEditor.autoMsg(module,'title');configuration.newButtons={};for(msg in configuration.buttons)
608607 configuration.newButtons[mw.usability.getMsg(msg)]=configuration.buttons[msg];configuration.buttons=configuration.newButtons;var dialogDiv=$('<div />').attr('id',module.id).html(module.html).data('context',context).appendTo($('body')).each(module.init).dialog(configuration);$.wikiEditor.modules.dialogs.fn.setTabindexes(dialogDiv.closest('.ui-dialog').find('button').not('[tabindex]'));if(!('resizeme'in module)||module.resizeme){dialogDiv.bind('dialogopen',$.wikiEditor.modules.dialogs.fn.resize).find('.ui-tabs').bind('tabsshow',function(){$(this).closest('.ui-dialog-content').each($.wikiEditor.modules.dialogs.fn.resize);});}
609608 dialogDiv.bind('dialogclose',function(){context.fn.restoreSelection();});context.$textarea.trigger('wikiEditor-dialogs-loaded-'+mod);});},resize:function(){var wrapper=$(this).closest('.ui-dialog');var oldWidth=wrapper.width();var oldHidden=$(this).find('*').not(':visible');oldHidden.each(function(){$(this).data('oldstyle',$(this).attr('style'));});oldHidden.show();var oldWS=$(this).css('white-space');$(this).css('white-space','nowrap');if(wrapper.width()<=$(this).get(0).scrollWidth){var thisWidth=$(this).data('thisWidth')?$(this).data('thisWidth'):0;thisWidth=Math.max($(this).get(0).scrollWidth,thisWidth);$(this).width(thisWidth);$(this).data('thisWidth',thisWidth);var wrapperWidth=$(this).data('wrapperWidth')?$(this).data('wrapperWidth'):0;wrapperWidth=Math.max(wrapper.get(0).scrollWidth,wrapperWidth);wrapper.width(wrapperWidth);$(this).data('wrapperWidth',wrapperWidth);$(this).dialog({'width':wrapper.width()});wrapper.css('left',parseInt(wrapper.css('left'))-(wrapper.width()-oldWidth)/2);}
610 -$(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});},setTabindexes:function($elements){var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI)
611 -maxTI=ti;});var tabIndex=maxTI+1;$elements.each(function(){$j(this).attr('tabindex',tabIndex++);});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(jQuery);(function($){$.wikiEditor.modules.highlight={'req':['iframe'],'cfg':{'styleVersion':3},'evt':{'delayedChange':function(context,event){if(event.data.scope=='realchange'){$.wikiEditor.modules.highlight.fn.scan(context);$.wikiEditor.modules.highlight.fn.mark(context,event.data.scope);}},'ready':function(context,event){$.wikiEditor.modules.highlight.fn.scan(context);$.wikiEditor.modules.highlight.fn.mark(context,'ready');}},'fn':{'create':function(context,config){context.modules.highlight.markersStr='';},'scan':function(context,division){var tokenArray=context.modules.highlight.tokenArray=[];var text=context.fn.getContents();for(var module in context.modules){if(module in $.wikiEditor.modules&&'exp'in $.wikiEditor.modules[module]){for(var exp in $.wikiEditor.modules[module].exp){var regex=$.wikiEditor.modules[module].exp[exp].regex;var label=$.wikiEditor.modules[module].exp[exp].label;var markAfter=$.wikiEditor.modules[module].exp[exp].markAfter||false;var offset=0,left,right,match;while((match=text.substr(offset).match(regex))!=null){right=(left=offset+match.index)+match[0].length;tokenArray[tokenArray.length]={'offset':markAfter?right:left,'label':label,'tokenStart':left,'match':match};offset=right;}}}}
 609+$(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});},setTabindexes:function($elements){var tabIndex=mw.usability.getMaxTabIndex()+1;$elements.each(function(){$j(this).attr('tabindex',tabIndex++);});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(jQuery);(function($){$.wikiEditor.modules.highlight={'req':['iframe'],'cfg':{'styleVersion':3},'evt':{'delayedChange':function(context,event){if(event.data.scope=='realchange'){$.wikiEditor.modules.highlight.fn.scan(context);$.wikiEditor.modules.highlight.fn.mark(context,event.data.scope);}},'ready':function(context,event){$.wikiEditor.modules.highlight.fn.scan(context);$.wikiEditor.modules.highlight.fn.mark(context,'ready');}},'fn':{'create':function(context,config){context.modules.highlight.markersStr='';},'scan':function(context,division){var tokenArray=context.modules.highlight.tokenArray=[];var text=context.fn.getContents();for(var module in context.modules){if(module in $.wikiEditor.modules&&'exp'in $.wikiEditor.modules[module]){for(var exp in $.wikiEditor.modules[module].exp){var regex=$.wikiEditor.modules[module].exp[exp].regex;var label=$.wikiEditor.modules[module].exp[exp].label;var markAfter=$.wikiEditor.modules[module].exp[exp].markAfter||false;var offset=0,left,right,match;while((match=text.substr(offset).match(regex))!=null){right=(left=offset+match.index)+match[0].length;tokenArray[tokenArray.length]={'offset':markAfter?right:left,'label':label,'tokenStart':left,'match':match};offset=right;}}}}
612610 tokenArray.sort(function(a,b){return a.tokenStart-b.tokenStart;});context.fn.trigger('scan');},'mark':function(context,division,tokens){var markers=[];if(context.modules.highlight.markers&&division!=''){for(var i=0;i<context.modules.highlight.markers.length;i++){if(context.modules.highlight.markers[i].skipDivision==division){markers.push(context.modules.highlight.markers[i]);}}}
613611 context.modules.highlight.markers=markers;context.fn.trigger('mark');markers.sort(function(a,b){return a.start-b.start||a.end-b.end;});var markersStr='';for(var i=0;i<markers.length;i++){markersStr+=markers[i].start+','+markers[i].end+','+markers[i].type+',';}
614612 if(context.modules.highlight.markersStr==markersStr){return;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r67744Solves code style issue in r67559 and removes debugger statement added in r67...tparscal18:54, 9 June 2010
r107729(bug 29749) ext.vector.collapsibleNav.js shouldn't excludes IE6...krinkle18:10, 31 December 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   00:46, 7 July 2011

Bug 29749 notes that this added a blacklisting for IE 6 and earlier, while the commit comment only says that it's switching from one set of compatibility check calls to another. Is there a compat issue with IE 6 on this or was this a cut-and-paste error?

Status & tagging log