r61567 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61566‎ | r61567 | r61568 >
Date:09:46, 27 January 2010
Author:tstarling
Status:ok
Tags:
Comment:
Moved the few necessary JS functions from js2/stopgap/core/whatever to a new common JS file, usability.js. The implementation is independent of the unstable MW core interface and uses the global mw object only for namespacing. Specifically:

* mw.ready -> $j(document).ready(), except for ClickTracking.js where jQuery is not available, so I used the traditional addOnloadHook() from wikibits.
* gM() -> mw.usability.getMsg()
* mw.load() -> mw.usability.load()
* mw.addMessages() -> mw.usability.addMessages()

Tested, seems to work.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Makefile (modified) (history)
  • /trunk/extensions/UsabilityInitiative/OptIn/OptIn.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/OptIn/OptIn.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/OptIn/SpecialOptIn.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/FooterCleanup/FooterCleanup.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.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/WikiEditor/Modules/Highlight/Highlight.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Preview/Preview.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Publish/Publish.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toc/Toc.js (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.wikiEditor.dialogs.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.preview.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.publish.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/tests/wikiEditor.toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/usability.js (added) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js
@@ -1,4 +1,4 @@
2 -mw.ready( function() {
 2+$j(document).ready( function() {
33 // Check if CollapsibleTabs is enabled
44 if ( !wgVectorEnabledModules.collapsibletabs ) {
55 return true;
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/FooterCleanup/FooterCleanup.js
@@ -1,7 +1,7 @@
22 /* Prototype code to demonstrate proposed edit page footer cleanups */
33 /* First draft and will be changing greatly */
44
5 -mw.ready( function() {
 5+$j(document).ready( function() {
66 if( !wgVectorEnabledModules.footercleanup ) {
77 return true;
88 }
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js
@@ -1,6 +1,6 @@
22 /* JavaScript for EditWarning extension */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check if EditWarning is enabled and if we need it
66 if ( !wgVectorEnabledModules.editwarning || $j( '#wpTextbox1' ).size() == 0 ) {
77 return true;
@@ -31,7 +31,7 @@
3232 $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
3333 ) {
3434 // Return our message
35 - return gM( 'vector-editwarning-warning' );
 35+ return mw.usability.getMsg( 'vector-editwarning-warning' );
3636 }
3737 }
3838 // Add form submission handler
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js
@@ -1,7 +1,7 @@
22 /* Prototype code to show collapsing left nav options */
33 /* First draft and will be changing greatly */
44
5 -mw.ready( function() {
 5+$j(document).ready( function() {
66 if( !wgVectorEnabledModules.collapsiblenav ) {
77 return true;
88 }
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js
@@ -7,7 +7,7 @@
88 os_autoload_forms = [];
99 }
1010
11 -mw.ready( function() {
 11+$j(document).ready( function() {
1212 // Only use this function in conjuction with the Vector skin
1313 if( !wgVectorEnabledModules.simplesearch || skin != 'vector' ) {
1414 return true;
@@ -16,7 +16,7 @@
1717 $j( 'div#simpleSearch > input#searchInput' )
1818 .each( function() {
1919 $j( '<label />' )
20 - .text( gM( 'vector-simplesearch-search' ) )
 20+ .text( mw.usability.getMsg( 'vector-simplesearch-search' ) )
2121 .css({
2222 'display': 'none',
2323 'position' : 'absolute',
@@ -95,7 +95,7 @@
9696 $j(this).show();
9797 $label = $j( '<div />' )
9898 .addClass( 'special-label' )
99 - .text( gM( 'vector-simplesearch-containing' ) )
 99+ .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) )
100100 .appendTo( $j(this) );
101101 $query = $j( '<div />' )
102102 .addClass( 'special-query' )
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -12,17 +12,17 @@
1313
1414 static $scripts = array(
1515 'raw' => array(
16 - array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 6 ),
17 - array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 6 ),
18 - array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 5 ),
19 - array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 4 ),
20 - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 6 ),
 16+ array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 7 ),
 17+ array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 7 ),
 18+ array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 6 ),
 19+ array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ),
 20+ array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 7 ),
2121 ),
2222 'combined' => array(
23 - array( 'src' => 'Vector.combined.js', 'version' => 18 ),
 23+ array( 'src' => 'Vector.combined.js', 'version' => 19 ),
2424 ),
2525 'minified' => array(
26 - array( 'src' => 'Vector.combined.min.js', 'version' => 18 ),
 26+ array( 'src' => 'Vector.combined.min.js', 'version' => 19 ),
2727 ),
2828 );
2929 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -1,7 +1,7 @@
22 /* Prototype code to show collapsing left nav options */
33 /* First draft and will be changing greatly */
44
5 -mw.ready( function() {
 5+$j(document).ready( function() {
66 if( !wgVectorEnabledModules.collapsiblenav ) {
77 return true;
88 }
@@ -35,7 +35,7 @@
3636 return false;
3737 } );
3838 } );
39 -mw.ready( function() {
 39+$j(document).ready( function() {
4040 // Check if CollapsibleTabs is enabled
4141 if ( !wgVectorEnabledModules.collapsibletabs ) {
4242 return true;
@@ -119,7 +119,7 @@
120120 } );
121121 /* JavaScript for EditWarning extension */
122122
123 -mw.ready( function() {
 123+$j(document).ready( function() {
124124 // Check if EditWarning is enabled and if we need it
125125 if ( !wgVectorEnabledModules.editwarning || $j( '#wpTextbox1' ).size() == 0 ) {
126126 return true;
@@ -150,7 +150,7 @@
151151 $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
152152 ) {
153153 // Return our message
154 - return gM( 'vector-editwarning-warning' );
 154+ return mw.usability.getMsg( 'vector-editwarning-warning' );
155155 }
156156 }
157157 // Add form submission handler
@@ -164,7 +164,7 @@
165165 /* Prototype code to demonstrate proposed edit page footer cleanups */
166166 /* First draft and will be changing greatly */
167167
168 -mw.ready( function() {
 168+$j(document).ready( function() {
169169 if( !wgVectorEnabledModules.footercleanup ) {
170170 return true;
171171 }
@@ -241,7 +241,7 @@
242242 os_autoload_forms = [];
243243 }
244244
245 -mw.ready( function() {
 245+$j(document).ready( function() {
246246 // Only use this function in conjuction with the Vector skin
247247 if( !wgVectorEnabledModules.simplesearch || skin != 'vector' ) {
248248 return true;
@@ -250,7 +250,7 @@
251251 $j( 'div#simpleSearch > input#searchInput' )
252252 .each( function() {
253253 $j( '<label />' )
254 - .text( gM( 'vector-simplesearch-search' ) )
 254+ .text( mw.usability.getMsg( 'vector-simplesearch-search' ) )
255255 .css({
256256 'display': 'none',
257257 'position' : 'absolute',
@@ -329,7 +329,7 @@
330330 $j(this).show();
331331 $label = $j( '<div />' )
332332 .addClass( 'special-label' )
333 - .text( gM( 'vector-simplesearch-containing' ) )
 333+ .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) )
334334 .appendTo( $j(this) );
335335 $query = $j( '<div />' )
336336 .addClass( 'special-query' )
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -1,15 +1,15 @@
22
3 -mw.ready(function(){if(!wgVectorEnabledModules.collapsiblenav){return true;}
4 -$j('#panel').addClass('collapsible-nav');$j('#panel > div.portal:first').addClass('expanded').find('div.body').show();$j('#panel > div.portal:not(:first)').each(function(){if($j.cookie('vector-nav-'+$j(this).attr('id'))=='true'){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}});$j('#panel > div.portal > h5').click(function(){$j.cookie('vector-nav-'+$j(this).parent().attr('id'),$j(this).parent().is('.collapsed'));$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');return false;});});mw.ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;}
 3+$j(document).ready(function(){if(!wgVectorEnabledModules.collapsiblenav){return true;}
 4+$j('#panel').addClass('collapsible-nav');$j('#panel > div.portal:first').addClass('expanded').find('div.body').show();$j('#panel > div.portal:not(:first)').each(function(){if($j.cookie('vector-nav-'+$j(this).attr('id'))=='true'){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}});$j('#panel > div.portal > h5').click(function(){$j.cookie('vector-nav-'+$j(this).parent().attr('id'),$j(this).parent().is('.collapsed'));$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');return false;});});$j(document).ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;}
55 var rtl=$j('body').is('.rtl');$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);$j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=true;var data=$moving.data('collapsibleTabsSettings');var target=$moving.data('collapsibleTabsSettings').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($j(ele).data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);$j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=true;var data=$moving.data('collapsibleTabsSettings');var $target=$j($moving.data('collapsibleTabsSettings').expandedContainer).find('span.placeholder:first');var expandedWidth=$moving.data('collapsibleTabsSettings').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($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none')
66 $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)
7 -$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;}}});});mw.ready(function(){if(!wgVectorEnabledModules.editwarning||$j('#wpTextbox1').size()==0){return true;}
 7+$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;}
88 $j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){var fallbackResult=null;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();}
99 if(fallbackResult!==null){return fallbackResult;}
10 -if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return gM('vector-editwarning-warning');}}
11 -$j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;mw.ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
 10+if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return mw.usability.getMsg('vector-editwarning-warning');}}
 11+$j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;$j(document).ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
1212 $j('#editpage-copywarn').add('.editOptions').wrapAll('<div id="editpage-bottom"></div>');$j('#wpSummary').data('hint',$j('#wpSummaryLabel span small').remove().text().replace(/\)|\(/g,'')).change(function(){if($j(this).val().length==0){$j(this).addClass('inline-hint').val($j(this).data('hint'));}else{$j(this).removeClass('inline-hint');}}).focus(function(){if($j(this).val()==$j(this).data('hint')){$j(this).removeClass('inline-hint').val("");}}).blur(function(){$j(this).trigger('change');}).trigger('change');$j('#wpSummary').add('.editCheckboxes').wrapAll('<div id="editpage-summary-fields"></div>');$j('#editpage-specialchars').remove();var transclusionCount=$j('.templatesUsed ul li').size();$j('.templatesUsed ul').wrap('<div id="transclusions-list" class="collapsible-list collapsed"></div>').parent().prepend('<label>This page contains <a href="http://en.wikipedia.org/wiki/transclusion">transclusions</a> of <strong>'
1313 +transclusionCount
1414 +'</strong> other pages.</label>');$j('.mw-templatesUsedExplanation').remove();$j('.collapsible-list label').click(function(){$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('ul').slideToggle('fast');return false;}).trigger('click');$j('#wpPreview, #wpDiff, .editHelp, #editpage-specialchars').remove();$j('#mw-editform-cancel').remove().appendTo('.editButtons');});if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];}
15 -mw.ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;}
16 -$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(gM('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(gM('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});});
\ No newline at end of file
 15+$j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;}
 16+$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});});
\ No newline at end of file
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -51,6 +51,8 @@
5252 // Core functionality of extension
5353 'base_sets' => array(
5454 'raw' => array(
 55+ // Common UsabilityInitiative funtions
 56+ array( 'src' => 'js/usability.js', 'version' => 1 ),
5557
5658 // These scripts can be pulled from core once the js2 is merged
5759 array( 'src' => 'js/js2stopgap/ui.core.js', 'version' => 1 ),
@@ -70,20 +72,20 @@
7173 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7274 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7375 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 26 ),
74 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 71 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 72 ),
7577 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 23 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 44 ),
77 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ),
78 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 73 ),
79 - array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 9 ),
 78+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 45 ),
 79+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 11 ),
 80+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 74 ),
 81+ array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 10 ),
8082 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 16 ),
81 - array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ),
 83+ array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8284 ),
8385 'combined' => array(
84 - array( 'src' => 'js/plugins.combined.js', 'version' => 183 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 184 ),
8587 ),
8688 'minified' => array(
87 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 183 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 184 ),
8890 ),
8991 ),
9092 );
@@ -162,7 +164,7 @@
163165 Xml::tags(
164166 'script',
165167 array( 'type' => $wgJsMimeType ),
166 - 'mw.addMessages({' . implode( ',', self::$messages ) . '});'
 168+ 'mw.usability.addMessages({' . implode( ',', self::$messages ) . '});'
167169 )
168170 );
169171 }
@@ -210,7 +212,7 @@
211213
212214 /**
213215 * Adds internationalized message definitions to the document for access
214 - * via javascript using the gM() function
 216+ * via javascript using the mw.usability.getMsg() function
215217 * @param array $messages Key names of messages to load
216218 */
217219 public static function addMessages( $messages ) {
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Increment this value when you change ClickTracking.js
23 -$wgClickTrackingStyleVersion = 3;
 23+$wgClickTrackingStyleVersion = 4;
2424
2525 // click throttle, should be seen as "1 out of every $wgClickTrackThrottle users will have it enabled"
2626 // setting this to 1 means all users will have it enabled
@@ -66,4 +66,4 @@
6767
6868 // Adds Internationalized Messages
6969 $wgExtensionMessagesFiles['ClickTracking'] = $dir . 'ClickTracking.i18n.php';
70 -$wgExtensionAliasesFiles['ClickTracking'] = $dir . 'ClickTracking.alias.php';
\ No newline at end of file
 70+$wgExtensionAliasesFiles['ClickTracking'] = $dir . 'ClickTracking.alias.php';
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.js
@@ -6,7 +6,7 @@
77 };
88
99 // Clicktrack the left sidebar links
10 - $(document).ready( function() {
 10+ addOnloadHook( function() {
1111 $( '#p-logo a, #p-navigation a, #p-tb a' ).click( function() {
1212 var id = 'leftnav-' + skin + '-' +
1313 ( $(this).attr( 'id' ) || $(this).parent().attr( 'id' ) );
@@ -23,4 +23,4 @@
2424 });
2525 }
2626
27 -})(jQuery);
\ No newline at end of file
 27+})(jQuery);
Index: trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.js
@@ -512,6 +512,6 @@
513513 })(jQuery);
514514
515515 // colorize the table on document.ready
516 -mw.ready( $j.colorizeTable );
517 -mw.ready( $j.changeDataLinks );
518 -mw.ready( $j.setUIControls );
\ No newline at end of file
 516+$j(document).ready( $j.colorizeTable );
 517+$j(document).ready( $j.changeDataLinks );
 518+$j(document).ready( $j.setUIControls );
Index: trunk/extensions/UsabilityInitiative/OptIn/OptIn.php
@@ -28,7 +28,7 @@
2929 $wgOptInAlwaysShowPersonalLink = false;
3030 $wgOptInNeverShowPersonalLink = false;
3131
32 -$wgOptInStyleVersion = 10;
 32+$wgOptInStyleVersion = 11;
3333
3434 // Preferences to set when users opt in
3535 // array( prefname => value )
Index: trunk/extensions/UsabilityInitiative/OptIn/SpecialOptIn.php
@@ -121,7 +121,7 @@
122122 $url = $this->getTitle()->getLinkUrl();
123123 $wgOut->addHTML( Xml::tags( 'script',
124124 array( 'type' => $wgJsMimeType ),
125 - 'mw.ready( function() { $j.post( "' . $url . '", optInGetPOSTData() ); } );'
 125+ '$j(document).ready( function() { $j.post( "' . $url . '", optInGetPOSTData() ); } );'
126126 ) );
127127 } else if ( self::isOptedIn( $wgUser ) ) {
128128 // User is already opted in but
Index: trunk/extensions/UsabilityInitiative/OptIn/OptIn.js
@@ -68,7 +68,7 @@
6969 'opt': 'browser' };
7070 }
7171
72 -mw.ready( function() {
 72+$j(document).ready( function() {
7373 $j( '.optin-other-select' ).parent().hide();
7474 $j( 'select.optin-need-other' ).change( function() {
7575 if( $j(this).val() == 'other' )
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Highlight module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for highlight
66 if ( !wgWikiEditorEnabledModules.highlight ) {
77 return true;
@@ -12,7 +12,7 @@
1313 });
1414 /* JavaScript for WikiEditor Preview module */
1515
16 -mw.ready( function() {
 16+$j(document).ready( function() {
1717 // Check preferences for preview
1818 if ( !wgWikiEditorEnabledModules.preview ) {
1919 return true;
@@ -24,7 +24,7 @@
2525 });
2626 /* JavaScript for WikiEditor Publish module */
2727
28 -mw.ready( function() {
 28+$j(document).ready( function() {
2929 // Check preferences for publish
3030 if ( !wgWikiEditorEnabledModules.publish ) {
3131 return true;
@@ -36,7 +36,7 @@
3737 });
3838 /* JavaScript for WikiEditor Toc module */
3939
40 -mw.ready( function() {
 40+$j(document).ready( function() {
4141 // Check preferences for toolbar
4242 if ( !wgWikiEditorPreferences || !( wgWikiEditorPreferences.toc && wgWikiEditorPreferences.toc.enable ) ) {
4343 return true;
@@ -49,7 +49,7 @@
5050 });
5151 /* JavaScript for WikiEditor Toolbar module */
5252
53 -mw.ready( function() {
 53+$j(document).ready( function() {
5454 // Check preferences for toolbar
5555 if ( !wgWikiEditorEnabledModules.toolbar ) {
5656 return true;
@@ -1009,17 +1009,18 @@
10101010 );
10111011 }
10121012 // Set labels of tabs based on rel values
 1013+ var u = mw.usability;
10131014 $j(this).find( '[rel]' ).each( function() {
1014 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 1015+ $j(this).text( u.getMsg( $j(this).attr( 'rel' ) ) );
10151016 });
10161017 // Setup the tooltips in the textboxes
10171018 $j( '#wikieditor-toolbar-link-int-target' )
1018 - .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
 1019+ .data( 'tooltip', u.getMsg( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
10191020 $j( '#wikieditor-toolbar-link-int-text' )
1020 - .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
 1021+ .data( 'tooltip', u.getMsg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
10211022 $j( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' )
10221023 .each( function() {
1023 - var tooltip = gM( $j( this ).attr( 'id' ) + '-tooltip' );
 1024+ var tooltip = u.getMsg( $j( this ).attr( 'id' ) + '-tooltip' );
10241025 if ( $j( this ).val() == '' )
10251026 $j( this )
10261027 .val( $j( this ).data( 'tooltip' ) )
@@ -1068,11 +1069,11 @@
10691070 });
10701071 // Add images to the page existence widget, which will be shown mutually exclusively to communicate if the
10711072 // page exists, does not exist or the title is invalid (like if it contains a | character)
1072 - var existsMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-exists' );
1073 - var notexistsMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-notexists' );
1074 - var invalidMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-invalid' );
1075 - var externalMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-external' );
1076 - var loadingMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-loading' );
 1073+ var existsMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-exists' );
 1074+ var notexistsMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-notexists' );
 1075+ var invalidMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-invalid' );
 1076+ var externalMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-external' );
 1077+ var loadingMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-loading' );
10771078 $j( '#wikieditor-toolbar-link-int-target-status' )
10781079 .append( $j( '<div />' )
10791080 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' )
@@ -1188,8 +1189,9 @@
11891190 var whitespace = $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace' );
11901191 var target = $j( '#wikieditor-toolbar-link-int-target' ).val();
11911192 var text = $j( '#wikieditor-toolbar-link-int-text' ).val();
 1193+ var u = mw.usability;
11921194 if ( target == '' ) {
1193 - alert( gM( 'wikieditor-toolbar-tool-link-empty' ) );
 1195+ alert( u.getMsg( 'wikieditor-toolbar-tool-link-empty' ) );
11941196 return;
11951197 }
11961198 if ( $j.trim( text ) == '' ) {
@@ -1201,7 +1203,7 @@
12021204 // FIXME: Exactly how fragile is this?
12031205 if ( $j( '#wikieditor-toolbar-link-int-target-status-invalid' ).is( ':visible' ) ) {
12041206 // Refuse to add links to invalid titles
1205 - alert( gM( 'wikieditor-toolbar-tool-link-int-invalid' ) );
 1207+ alert( u.getMsg( 'wikieditor-toolbar-tool-link-int-invalid' ) );
12061208 return;
12071209 }
12081210
@@ -1219,18 +1221,18 @@
12201222 if ( match && !$j(this).data( 'ignoreLooksInternal' ) ) {
12211223 var buttons = { };
12221224 var that = this;
1223 - buttons[ gM( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = function() {
 1225+ buttons[ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = function() {
12241226 $j( '#wikieditor-toolbar-link-int-target' ).val( match[1] ).change();
12251227 $j(this).dialog( 'close' );
12261228 };
1227 - buttons[ gM( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = function() {
 1229+ buttons[ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = function() {
12281230 $j(that).data( 'ignoreLooksInternal', true );
12291231 $j(that).closest( '.ui-dialog' ).find( 'button:first' ).click();
12301232 $j(that).data( 'ignoreLooksInternal', false );
12311233 $j(this).dialog( 'close' );
12321234 };
12331235 $j.wikiEditor.modules.dialogs.quickDialog(
1234 - gM( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ),
 1236+ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ),
12351237 { buttons: buttons }
12361238 );
12371239 return;
@@ -1399,7 +1401,7 @@
14001402 </div></div>',
14011403 init: function() {
14021404 $j(this).find( '[rel]' ).each( function() {
1403 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 1405+ $j(this).text( mw.usability.getMsg( $j(this).attr( 'rel' ) ) );
14041406 });
14051407 $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
14061408 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
@@ -1456,20 +1458,21 @@
14571459 var rows = parseInt( rowsVal, 10 );
14581460 var cols = parseInt( colsVal, 10 );
14591461 var header = Math.min( 1, $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).size() );
 1462+ var u = mw.usability;
14601463 if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
1461 - alert( gM( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
 1464+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
14621465 return;
14631466 }
14641467 if ( rows + header == 0 || cols == 0 ) {
1465 - alert( gM( 'wikieditor-toolbar-tool-table-zero' ) );
 1468+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-zero' ) );
14661469 return;
14671470 }
14681471 if ( rows * cols > 1000 ) {
1469 - alert( gM( 'wikieditor-toolbar-tool-table-toomany', 1000 ) );
 1472+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-toomany', 1000 ) );
14701473 return;
14711474 }
1472 - var headerText = gM( 'wikieditor-toolbar-tool-table-example-header' );
1473 - var normalText = gM( 'wikieditor-toolbar-tool-table-example' );
 1475+ var headerText = u.getMsg( 'wikieditor-toolbar-tool-table-example-header' );
 1476+ var normalText = u.getMsg( 'wikieditor-toolbar-tool-table-example' );
14741477 var table = "";
14751478 for ( var r = 0; r < rows + header; r++ ) {
14761479 table += "|-\n";
@@ -1575,8 +1578,9 @@
15761579 </div>\
15771580 </fieldset>',
15781581 init: function() {
 1582+ var u = mw.usability;
15791583 $j(this).find( '[rel]' ).each( function() {
1580 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 1584+ $j(this).text( u.getMsg( $j(this).attr( 'rel' ) ) );
15811585 });
15821586
15831587 // TODO: Find a cleaner way to share this function
@@ -1604,7 +1608,7 @@
16051609 var regex = new RegExp( searchStr, flags );
16061610 } catch( e ) {
16071611 $j( '#wikieditor-toolbar-replace-invalidregex' )
1608 - .text( gM( 'wikieditor-toolbar-tool-replace-invalidregex',
 1612+ .text( u.getMsg( 'wikieditor-toolbar-tool-replace-invalidregex',
16091613 e.message ) )
16101614 .show();
16111615 return;
@@ -1653,7 +1657,7 @@
16541658 offset = newEnd;
16551659 }
16561660 $j( '#wikieditor-toolbar-replace-success' )
1657 - .text( gM( 'wikieditor-toolbar-tool-replace-success', match.length ) )
 1661+ .text( u.getMsg( 'wikieditor-toolbar-tool-replace-success', match.length ) )
16581662 .show();
16591663 $j(this).data( 'offset', 0 );
16601664 } else {
@@ -1745,7 +1749,7 @@
17461750
17471751 /* JavaScript for WikiEditor Template Editor module */
17481752
1749 -mw.ready( function() {
 1753+$j(document).ready( function() {
17501754 // Check preferences for templateEditor
17511755 if ( !wgWikiEditorEnabledModules.templateEditor ) {
17521756 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -1,9 +1,9 @@
22
3 -mw.ready(function(){if(!wgWikiEditorEnabledModules.highlight){return true;}
4 -if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','highlight');}});mw.ready(function(){if(!wgWikiEditorEnabledModules.preview){return true;}
5 -if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','preview');}});mw.ready(function(){if(!wgWikiEditorEnabledModules.publish){return true;}
6 -if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','publish');}});mw.ready(function(){if(!wgWikiEditorPreferences||!(wgWikiEditorPreferences.toc&&wgWikiEditorPreferences.toc.enable)){return true;}
7 -if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule',{'toc':{'rtl':($j('body').is('.rtl'))}});}});mw.ready(function(){if(!wgWikiEditorEnabledModules.toolbar){return true;}
 3+$j(document).ready(function(){if(!wgWikiEditorEnabledModules.highlight){return true;}
 4+if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','highlight');}});$j(document).ready(function(){if(!wgWikiEditorEnabledModules.preview){return true;}
 5+if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','preview');}});$j(document).ready(function(){if(!wgWikiEditorEnabledModules.publish){return true;}
 6+if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','publish');}});$j(document).ready(function(){if(!wgWikiEditorPreferences||!(wgWikiEditorPreferences.toc&&wgWikiEditorPreferences.toc.enable)){return true;}
 7+if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule',{'toc':{'rtl':($j('body').is('.rtl'))}});}});$j(document).ready(function(){if(!wgWikiEditorEnabledModules.toolbar){return true;}
88 if(wgWikiEditorPreferences.toolbar.dialogs){$j('#wpTextbox1').addClass('toolbar-dialogs');}
99 if($j.fn.wikiEditor){$j('#toolbar').remove();$j('#wpTextbox1').wikiEditor('addModule',{'toolbar':{'main':{type:'toolbar',groups:{'format':{tools:{'bold':{labelMsg:'wikieditor-toolbar-tool-bold',type:'button',icon:{'default':'format-bold.png','en':'format-bold-B.png','de':'format-bold-F.png','fr':'format-bold-G.png','es':'format-bold-N.png','it':'format-bold-G.png','nl':'format-bold-V.png','pt':'format-bold-N.png','pt-br':'format-bold-N.png','pl':'format-bold-P.png'},action:{type:'encapsulate',options:{pre:"'''",periMsg:'wikieditor-toolbar-tool-bold-example',post:"'''"}}},'italic':{section:'main',group:'format',id:'italic',labelMsg:'wikieditor-toolbar-tool-italic',type:'button',icon:{'default':'format-italic.png','en':'format-italic-I.png','de':'format-italic-K.png','fr':'format-italic-I.png','es':'format-italic-C.png','it':'format-italic-C.png','nl':'format-italic-C.png','pt':'format-italic-I.png','pt-br':'format-italic-I.png','pl':'format-italic-K.png'},action:{type:'encapsulate',options:{pre:"''",periMsg:'wikieditor-toolbar-tool-italic-example',post:"''"}}}}},'insert':{tools:{'xlink':{labelMsg:'wikieditor-toolbar-tool-xlink',type:'button',icon:'insert-xlink.png',filters:['#wpTextbox1:not(.toolbar-dialogs)'],action:{type:'encapsulate',options:{pre:"[",periMsg:'wikieditor-toolbar-tool-xlink-example',post:"]"}}},'ilink':{labelMsg:'wikieditor-toolbar-tool-ilink',type:'button',icon:'insert-ilink.png',filters:['#wpTextbox1:not(.toolbar-dialogs)'],action:{type:'encapsulate',options:{pre:"[[",periMsg:'wikieditor-toolbar-tool-ilink-example',post:"]]"}}},'linkCGD':{labelMsg:'wikieditor-toolbar-tool-link',type:'button',icon:'insert-link.png',filters:['#wpTextbox1.toolbar-dialogs'],action:{type:'dialog',module:'insert-link'}},'file':{labelMsg:'wikieditor-toolbar-tool-file',type:'button',icon:'insert-file.png',action:{type:'encapsulate',options:{pre:"[[",preMsg:'wikieditor-toolbar-tool-file-pre',periMsg:'wikieditor-toolbar-tool-file-example',post:"]]"}}},'reference':{labelMsg:'wikieditor-toolbar-tool-reference',filters:['body.ns-subject'],type:'button',icon:'insert-reference.png',action:{type:'encapsulate',options:{pre:"<ref>",periMsg:'wikieditor-toolbar-tool-reference-example',post:"</ref>"}}},'signature':{labelMsg:'wikieditor-toolbar-tool-signature',filters:['body:not(.ns-0)'],type:'button',icon:'insert-signature.png',action:{type:'encapsulate',options:{post:"--~~~~"}}}}}}},'advanced':{labelMsg:'wikieditor-toolbar-section-advanced',type:'toolbar',groups:{'heading':{tools:{'heading':{labelMsg:'wikieditor-toolbar-tool-heading',type:'select',list:{'heading-2':{labelMsg:'wikieditor-toolbar-tool-heading-2',action:{type:'replace',options:{pre:'==',periMsg:'wikieditor-toolbar-tool-heading-example',post:'==',regex:/^(\s*)(={0,6})(.*?)\2(\s*)$/,regexReplace:"\$1==\$3==\$4",ownline:true}}},'heading-3':{labelMsg:'wikieditor-toolbar-tool-heading-3',action:{type:'replace',options:{pre:'===',periMsg:'wikieditor-toolbar-tool-heading-example',post:'===',regex:/^(\s*)(={0,6})(.*?)\2(\s*)$/,regexReplace:"\$1===\$3===\$4",ownline:true}}},'heading-4':{labelMsg:'wikieditor-toolbar-tool-heading-4',action:{type:'replace',options:{pre:'====',periMsg:'wikieditor-toolbar-tool-heading-example',post:'====',regex:/^(\s*)(={0,6})(.*?)\2(\s*)$/,regexReplace:"\$1====\$3====\$4",ownline:true}}},'heading-5':{labelMsg:'wikieditor-toolbar-tool-heading-5',action:{type:'replace',options:{pre:'=====',periMsg:'wikieditor-toolbar-tool-heading-example',post:'=====',regex:/^(\s*)(={0,6})(.*?)\2(\s*)$/,regexReplace:"\$1=====\$3=====\$4",ownline:true}}}}}}},'list':{labelMsg:'wikieditor-toolbar-group-list',tools:{'ulist':{labelMsg:'wikieditor-toolbar-tool-ulist',type:'button',icon:'format-ulist.png',action:{type:'encapsulate',options:{pre:"* ",periMsg:'wikieditor-toolbar-tool-ulist-example',post:"",ownline:true}}},'olist':{labelMsg:'wikieditor-toolbar-tool-olist',type:'button',icon:'format-olist.png',action:{type:'encapsulate',options:{pre:"# ",periMsg:'wikieditor-toolbar-tool-olist-example',post:"",ownline:true}}},'indent':{labelMsg:'wikieditor-toolbar-tool-indent',type:'button',icon:'format-indent.png',action:{type:'encapsulate',options:{pre:":",periMsg:'wikieditor-toolbar-tool-indent-example',post:"",ownline:true,splitlines:true}}}}},'size':{labelMsg:'wikieditor-toolbar-group-size',tools:{'big':{labelMsg:'wikieditor-toolbar-tool-big',type:'button',icon:'format-big.png',action:{type:'encapsulate',options:{pre:"<big>",periMsg:'wikieditor-toolbar-tool-big-example',post:"</big>"}}},'small':{labelMsg:'wikieditor-toolbar-tool-small',type:'button',icon:'format-small.png',action:{type:'encapsulate',options:{pre:"<small>",periMsg:'wikieditor-toolbar-tool-small-example',post:"</small>"}}}}},'baseline':{labelMsg:'wikieditor-toolbar-group-baseline',tools:{'superscript':{labelMsg:'wikieditor-toolbar-tool-superscript',type:'button',icon:'format-superscript.png',action:{type:'encapsulate',options:{pre:"<sup>",periMsg:'wikieditor-toolbar-tool-superscript-example',post:"</sup>"}}},'subscript':{labelMsg:'wikieditor-toolbar-tool-subscript',type:'button',icon:'format-subscript.png',action:{type:'encapsulate',options:{pre:"<sub>",periMsg:'wikieditor-toolbar-tool-subscript-example',post:"</sub>"}}}}},'insert':{labelMsg:'wikieditor-toolbar-group-insert',tools:{'gallery':{labelMsg:'wikieditor-toolbar-tool-gallery',type:'button',icon:'insert-gallery.png',action:{type:'encapsulate',options:{pre:"<gallery>\n",periMsg:'wikieditor-toolbar-tool-gallery-example',post:"\n</gallery>",ownline:true}}},'tableCGD':{labelMsg:'wikieditor-toolbar-tool-table',type:'button',icon:'insert-table.png',filters:['#wpTextbox1.toolbar-dialogs'],action:{type:'dialog',module:'insert-table'}},'table':{labelMsg:'wikieditor-toolbar-tool-table',type:'button',icon:'insert-table.png',filters:['#wpTextbox1:not(.toolbar-dialogs)'],action:{type:'encapsulate',options:{pre:"{| class=\"wikitable\" border=\"1\"\n|",periMsg:'wikieditor-toolbar-tool-table-example-old',post:"\n|}",ownline:true}}},'newline':{labelMsg:'wikieditor-toolbar-tool-newline',type:'button',icon:'insert-newline.png',action:{type:'encapsulate',options:{pre:"<br />\n"}}}}},'search':{tools:{'replace':{labelMsg:'wikieditor-toolbar-tool-replace',type:'button',icon:'search-replace.png',filters:['#wpTextbox1.toolbar-dialogs'],action:{type:'dialog',module:'search-and-replace'}}}}}},'characters':{labelMsg:'wikieditor-toolbar-section-characters',type:'booklet',pages:{'latin':{'labelMsg':'wikieditor-toolbar-characters-page-latin','layout':'characters','characters':["\u00c1","\u00e1","\u00c0","\u00e0","\u00c2","\u00e2","\u00c4","\u00e4","\u00c3","\u00e3","\u01cd","\u01ce","\u0100","\u0101","\u0102","\u0103","\u0104","\u0105","\u00c5","\u00e5","\u0106","\u0107","\u0108","\u0109","\u00c7","\u00e7","\u010c","\u010d","\u010a","\u010b","\u0110","\u0111","\u010e","\u010f","\u00c9","\u00e9","\u00c8","\u00e8","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0114","\u0115","\u0116","\u0117","\u0118","\u0119","\u011c","\u011d","\u0122","\u0123","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u0126","\u0127","\u00cd","\u00ed","\u00cc","\u00ec","\u00ce","\u00ee","\u00cf","\u00ef","\u0128","\u0129","\u01cf","\u01d0","\u012a","\u012b","\u012c","\u012d","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d3","\u00f3","\u00d2","\u00f2","\u00d4","\u00f4","\u00d6","\u00f6","\u00d5","\u00f5","\u01d1","\u01d2","\u014c","\u014d","\u014e","\u014f","\u01ea","\u01eb","\u0150","\u0151","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015c","\u015d","\u015e","\u015f","\u0160","\u0161","\u0162","\u0163","\u0164","\u0165","\u00da","\u00fa","\u00d9","\u00f9","\u00db","\u00fb","\u00dc","\u00fc","\u0168","\u0169","\u016e","\u016f","\u01d3","\u01d4","\u016a","\u016b","\u01d6","\u01d8","\u01da","\u01dc","\u016c","\u016d","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0176","\u0177","\u0178","\u00ff","\u0232","\u0233","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00c6","\u00e6","\u01e2","\u01e3","\u00d8","\u00f8","\u0152","\u0153","\u00df","\u00f0","\u00de","\u00fe","\u018f","\u0259"]},'latinextended':{'labelMsg':'wikieditor-toolbar-characters-page-latinextended','layout':'characters','characters':["\u1e00","\u1e01","\u1e9a","\u1ea0","\u1ea1","\u1ea2","\u1ea3","\u1ea4","\u1ea5","\u1ea6","\u1ea7","\u1ea8","\u1ea9","\u1eaa","\u1eab","\u1eac","\u1ead","\u1eae","\u1eaf","\u1eb0","\u1eb1","\u1eb2","\u1eb3","\u1eb4","\u1eb5","\u1eb6","\u1eb7","\u1e02","\u1e03","\u1e04","\u1e05","\u1e06","\u1e07","\u1e08","\u1e09","\u1e0a","\u1e0b","\u1e0c","\u1e0d","\u1e0e","\u1e0f","\u1e10","\u1e11","\u1e12","\u1e13","\u1e14","\u1e15","\u1e16","\u1e17","\u1e18","\u1e19","\u1e1a","\u1e1b","\u1e1c","\u1e1d","\u1eb8","\u1eb9","\u1eba","\u1ebb","\u1ebc","\u1ebd","\u1ebe","\u1ebf","\u1ec0","\u1ec1","\u1ec2","\u1ec3","\u1ec4","\u1ec5","\u1ec6","\u1ec7","\u1e1e","\u1e1f","\u1e20","\u1e21","\u1e22","\u1e23","\u1e24","\u1e25","\u1e26","\u1e27","\u1e28","\u1e29","\u1e2a","\u1e2b","\u1e96","\u1e2c","\u1e2d","\u1e2e","\u1e2f","\u1ec8","\u1ec9","\u1eca","\u1ecb","\u1e30","\u1e31","\u1e32","\u1e33","\u1e34","\u1e35","\u1e36","\u1e37","\u1e38","\u1e39","\u1e3a","\u1e3b","\u1e3c","\u1e3d","\u1efa","\u1efb","\u1e3e","\u1e3f","\u1e40","\u1e41","\u1e42","\u1e43","\u1e44","\u1e45","\u1e46","\u1e47","\u1e48","\u1e49","\u1e4a","\u1e4b","\u1e4c","\u1e4d","\u1e4e","\u1e4f","\u1e50","\u1e51","\u1e52","\u1e53","\u1ecc","\u1ecd","\u1ece","\u1ecf","\u1ed0","\u1ed1","\u1ed2","\u1ed3","\u1ed4","\u1ed5","\u1ed6","\u1ed7","\u1ed8","\u1ed9","\u1eda","\u1edb","\u1edc","\u1edd","\u1ede","\u1edf","\u1ee0","\u1ee1","\u1ee2","\u1ee3","\u1e54","\u1e55","\u1e56","\u1e57","\u1e58","\u1e59","\u1e5a","\u1e5b","\u1e5c","\u1e5d","\u1e5e","\u1e5f","\u1e60","\u1e61","\u1e9b","\u1e62","\u1e63","\u1e64","\u1e65","\u1e66","\u1e67","\u1e68","\u1e69","\u1e9c","\u1e9d","\u1e6a","\u1e6b","\u1e6c","\u1e6d","\u1e6e","\u1e6f","\u1e70","\u1e71","\u1e97","\u1e72","\u1e73","\u1e74","\u1e75","\u1e76","\u1e77","\u1e78","\u1e79","\u1e7a","\u1e7b","\u1ee4","\u1ee5","\u1ee6","\u1ee7","\u1ee8","\u1ee9","\u1eea","\u1eeb","\u1eec","\u1eed","\u1eee","\u1eef","\u1ef0","\u1ef1","\u1e7c","\u1e7d","\u1e7e","\u1e7f","\u1efc","\u1efd","\u1e80","\u1e81","\u1e82","\u1e83","\u1e84","\u1e85","\u1e86","\u1e87","\u1e88","\u1e89","\u1e98","\u1e8a","\u1e8b","\u1e8c","\u1e8d","\u1e8e","\u1e8f","\u1e99","\u1ef2","\u1ef3","\u1ef4","\u1ef5","\u1ef6","\u1ef7","\u1ef8","\u1ef9","\u1efe","\u1eff","\u1e90","\u1e91","\u1e92","\u1e93","\u1e94","\u1e95","\u1e9e","\u1e9f"]},'ipa':{labelMsg:'wikieditor-toolbar-characters-page-ipa',layout:'characters',characters:["p","t\u032a","t","\u0288","c","k","q","\u02a1","\u0294","b","d\u032a","d","\u0256","\u025f","\u0261","\u0262","\u0253","\u0257","\u0284","\u0260","\u029b","t\u0361s","t\u0361\u0283","t\u0361\u0255","d\u0361z","d\u0361\u0292","d\u0361\u0291","\u0278","f","\u03b8","s","\u0283","\u0285","\u0286","\u0282","\u0255","\u00e7","\u0267","x","\u03c7","\u0127","\u029c","h","\u03b2","v","\u028d","\u00f0","z","\u0292","\u0293","\u0290","\u0291","\u029d","\u0263","\u0281","\u0295","\u0296","\u02a2","\u0266","\u026c","\u026e","m","m\u0329","\u0271","\u0271\u0329","\u0271\u030d","n\u032a","n\u032a\u030d","n","n\u0329","\u0273","\u0273\u0329","\u0272","\u0272\u0329","\u014b","\u014b\u030d","\u014b\u0329","\u0274","\u0274\u0329","\u0299","\u0299\u0329","r","r\u0329","\u0280","\u0280\u0329","\u027e","\u027d","\u027f","\u027a","l\u032a","l\u032a\u0329","l","l\u0329","\u026b","\u026b\u0329","\u026d","\u026d\u0329","\u028e","\u028e\u0329","\u029f","\u029f\u0329","w","\u0265","\u028b","\u0279","\u027b","j","\u0270","\u0298","\u01c2","\u01c0","!","\u01c1","\u02b0","\u02b1","\u02b7","\u02b8","\u02b2","\u02b3","\u207f","\u02e1","\u02b4","\u02b5","\u02e2","\u02e3","\u02e0","\u02b6","\u02e4","\u02c1","\u02c0","\u02bc","i","i\u032f","\u0129","y","y\u032f","\u1ef9","\u026a","\u026a\u032f","\u026a\u0303","\u028f","\u028f\u032f","\u028f\u0303","\u0268","\u0268\u032f","\u0268\u0303","\u0289","\u0289\u032f","\u0289\u0303","\u026f","\u026f\u032f","\u026f\u0303","u","u\u032f","\u0169","\u028a","\u028a\u032f","\u028a\u0303","e","e\u032f","\u1ebd","\u00f8","\u00f8\u032f","\u00f8\u0303","\u0258","\u0258\u032f","\u0258\u0303","\u0275","\u0275\u032f","\u0275\u0303","\u0264","\u0264\u032f","\u0264\u0303","o","o\u032f","\u00f5","\u025b","\u025b\u032f","\u025b\u0303","\u0153","\u0153\u032f","\u0153\u0303","\u025c","\u025c\u032f","\u025c\u0303","\u0259","\u0259\u032f","\u0259\u0303","\u025e","\u025e\u032f","\u025e\u0303","\u028c","\u028c\u032f","\u028c\u0303","\u0254","\u0254\u032f","\u0254\u0303","\u00e6","\u00e6\u032f","\u00e6\u0303","\u0276","\u0276\u032f","\u0276\u0303","a","a\u032f","\u00e3","\u0250","\u0250\u032f","\u0250\u0303","\u0251","\u0251\u032f","\u0251\u0303","\u0252","\u0252\u032f","\u0252\u0303","\u02c8","\u02cc","\u02d0","\u02d1","\u02d8",".","\u203f","|","\u2016"]},'symbols':{'labelMsg':'wikieditor-toolbar-characters-page-symbols','layout':'characters','characters':["~","|","\u00a1","\u00bf","\u2020","\u2021","\u2194","\u2191","\u2193","\u2022","\u00b6","#","\u00bd","\u2153","\u2154","\u00bc","\u00be","\u215b","\u215c","\u215d","\u215e","\u221e","\u2018","\u201e","\u201c","\u2019","\u201d",{'label':"\u00ab\u00bb",'action':{'type':'encapsulate','options':{'pre':"\u00ab",'post':"\u00bb"}}},"\u00a4","\u20b3","\u0e3f","\u20b5","\u00a2","\u20a1","\u20a2","$","\u20ab","\u20af","\u20ac","\u20a0","\u20a3","\u0192","\u20b4","\u20ad","\u20a4","\u2133","\u20a5","\u20a6","\u2116","\u20a7","\u20b0","\u00a3","\u17db","\u20a8","\u20aa","\u09f3","\u20ae","\u20a9","\u00a5","\u2660","\u2663","\u2665","\u2666","m\u00b2","m\u00b3","\u2013","\u2014","\u2026","\u2018","\u201c","\u2019","\u201d","\u00b0","\u2033","\u2032","\u2248","\u2260","\u2264","\u2265","\u00b1","\u2212","\u00d7","\u00f7","\u2190","\u2192","\u00b7","\u00a7"]},'greek':{'labelMsg':'wikieditor-toolbar-characters-page-greek','layout':'characters','language':'hl','characters':["\u0391","\u0386","\u03b1","\u03ac","\u0392","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u0395","\u0388","\u03b5","\u03ad","\u0396","\u03b6","\u0397","\u0389","\u03b7","\u03ae","\u0398","\u03b8","\u0399","\u038a","\u03b9","\u03af","\u039a","\u03ba","\u039b","\u03bb","\u039c","\u03bc","\u039d","\u03bd","\u039e","\u03be","\u039f","\u038c","\u03bf","\u03cc","\u03a0","\u03c0","\u03a1","\u03c1","\u03a3","\u03c3","\u03c2","\u03a4","\u03c4","\u03a5","\u038e","\u03c5","\u03cd","\u03a6","\u03c6","\u03a7","\u03c7","\u03a8","\u03c8","\u03a9","\u038f","\u03c9","\u03ce"]},'cyrillic':{'labelMsg':'wikieditor-toolbar-characters-page-cyrillic','layout':'characters','characters':["\u0410","\u0430","\u04d8","\u04d9","\u0411","\u0431","\u0412","\u0432","\u0413","\u0433","\u0490","\u0491","\u0403","\u0453","\u0492","\u0493","\u0414","\u0434","\u0402","\u0452","\u0415","\u0435","\u0404","\u0454","\u0401","\u0451","\u0416","\u0436","\u0417","\u0437","\u0405","\u0455","\u0418","\u0438","\u0406","\u0456","\u0407","\u0457","\u0130","\u0419","\u0439","\u04e2","\u04e3","\u0408","\u0458","\u041a","\u043a","\u040c","\u045c","\u049a","\u049b","\u041b","\u043b","\u0409","\u0459","\u041c","\u043c","\u041d","\u043d","\u040a","\u045a","\u04a2","\u04a3","\u041e","\u043e","\u04e8","\u04e9","\u041f","\u043f","\u0420","\u0440","\u0421","\u0441","\u0422","\u0442","\u040b","\u045b","\u0423","\u0443","\u040e","\u045e","\u04ee","\u04ef","\u04b0","\u04b1","\u04ae","\u04af","\u0424","\u0444","\u0425","\u0445","\u04b2","\u04b3","\u04ba","\u04bb","\u0426","\u0446","\u0427","\u0447","\u04b6","\u04b7","\u040f","\u045f","\u0428","\u0448","\u0429","\u0449","\u042a","\u044a","\u042b","\u044b","\u042c","\u044c","\u042d","\u044d","\u042e","\u044e","\u042f","\u044f"]},'arabic':{'labelMsg':'wikieditor-toolbar-characters-page-arabic','layout':'characters','language':'ar','direction':'rtl','characters':["\u061b","\u061f","\u0621","\u0622","\u0623","\u0624","\u0625","\u0626","\u0627","\u0628","\u0629","\u062a","\u062b","\u062c","\u062d","\u062e","\u062f","\u0630","\u0631","\u0632","\u0633","\u0634","\u0635","\u0636","\u0637","\u0638","\u0639","\u063a","\u0641","\u0642","\u0643","\u0644","\u0645","\u0646","\u0647","\u0648","\u0649","\u064a","\u060c","\u067e","\u0686","\u0698","\u06af","\u06ad"]},'hebrew':{'labelMsg':'wikieditor-toolbar-characters-page-hebrew','layout':'characters','direction':'rtl','characters':["\u05d0","\u05d1","\u05d2","\u05d3","\u05d4","\u05d5","\u05d6","\u05d7","\u05d8","\u05d9","\u05db","\u05da","\u05dc","\u05de","\u05dd","\u05e0","\u05df","\u05e1","\u05e2","\u05e4","\u05e3","\u05e6","\u05e5","\u05e7","\u05e8","\u05e9","\u05ea","\u05f3","\u05f4","\u05f0","\u05f1","\u05f2","\u05d0","\u05d3","\u05d4","\u05d5","\u05d6","\u05d7","\u05d8","\u05d9","\u05da","\u05db","\u05dc","\u05dd","\u05de","\u05df","\u05e0","\u05e1","\u05e2","\u05e3","\u05e4","\u05be","\u05f3","\u05f4",["\u05b0\u25cc","\u05b0"],["\u05b1\u25cc","\u05b1"],["\u05b2\u25cc","\u05b2"],["\u05b3\u25cc","\u05b3"],["\u05b4\u25cc","\u05b4"],["\u05b5\u25cc","\u05b5"],["\u05b6\u25cc","\u05b6"],["\u05b7\u25cc","\u05b7"],["\u05b8\u25cc","\u05b8"],["\u05b9\u25cc","\u05b9"],["\u05bb\u25cc","\u05bb"],["\u05bc\u25cc","\u05bc"],["\u05c1\u25cc","\u05c1"],["\u05c2\u25cc","\u05c2"],["\u05c7\u25cc","\u05c7"],["\u0591\u25cc","\u0591"],["\u0592\u25cc","\u0592"],["\u0593\u25cc","\u0593"],["\u0594\u25cc","\u0594"],["\u0595\u25cc","\u0595"],["\u0596\u25cc","\u0596"],["\u0597\u25cc","\u0597"],["\u0598\u25cc","\u0598"],["\u0599\u25cc","\u0599"],["\u059a\u25cc","\u059a"],["\u059b\u25cc","\u059b"],["\u059c\u25cc","\u059c"],["\u059d\u25cc","\u059d"],["\u059e\u25cc","\u059e"],["\u059f\u25cc","\u059f"],["\u05a0\u25cc","\u05a0"],["\u05a1\u25cc","\u05a1"],["\u05a2\u25cc","\u05a2"],["\u05a3\u25cc","\u05a3"],["\u05a4\u25cc","\u05a4"],["\u05a5\u25cc","\u05a5"],["\u05a6\u25cc","\u05a6"],["\u05a7\u25cc","\u05a7"],["\u05a8\u25cc","\u05a8"],["\u05a9\u25cc","\u05a9"],["\u05aa\u25cc","\u05aa"],["\u05ab\u25cc","\u05ab"],["\u05ac\u25cc","\u05ac"],["\u05ad\u25cc","\u05ad"],["\u05ae\u25cc","\u05ae"],["\u05af\u25cc","\u05af"],["\u05bf\u25cc","\u05bf"],["\u05c0\u25cc","\u05c0"],["\u05c3\u25cc","\u05c3"]]},'telugu':{'labelMsg':'wikieditor-toolbar-characters-page-telugu','language':'te','layout':'characters','characters':["\u0c01","\u0c02","\u0c03","\u0c05","\u0c06","\u0c07","\u0c08","\u0c09","\u0c0a","\u0c0b","\u0c60","\u0c0c","\u0c61","\u0c0e","\u0c0f","\u0c10","\u0c12","\u0c13","\u0c14","\u0c15","\u0c16","\u0c17","\u0c18","\u0c19","\u0c1a","\u0c1b","\u0c1c","\u0c1d","\u0c1e","\u0c1f","\u0c20","\u0c21","\u0c22","\u0c23","\u0c24","\u0c25","\u0c26","\u0c27","\u0c28","\u0c2a","\u0c2b","\u0c2c","\u0c2d","\u0c2e","\u0c2f","\u0c30","\u0c31","\u0c32","\u0c33","\u0c35","\u0c36","\u0c37","\u0c38","\u0c39","\u0c3e","\u0c3f","\u0c40","\u0c41","\u0c42","\u0c43","\u0c44","\u0c46","\u0c47","\u0c48","\u0c4a","\u0c4b","\u0c4c","\u0c4d","\u0c62","\u0c63","\u0c58","\u0c59","\u0c66","\u0c67","\u0c68","\u0c69","\u0c6a","\u0c6b","\u0c6c","\u0c6d","\u0c6e","\u0c6f","\u0c3d","\u0c78","\u0c79","\u0c7a","\u0c7b","\u0c7c","\u0c7d","\u0c7e","\u0c7f"]},'sinhala':{'labelMsg':'wikieditor-toolbar-characters-page-sinhala','language':'si','layout':'characters','characters':["\u0d85","\u0d86","\u0d87","\u0d88","\u0d89","\u0d8a","\u0d8b","\u0d8c","\u0d8d","\u0d8e","\u0d8f","\u0d90","\u0d91","\u0d92","\u0d93","\u0d94","\u0d95","\u0d96","\u0d9a","\u0d9b","\u0d9c","\u0d9d","\u0d9e","\u0d9f","\u0da0","\u0da1","\u0da2","\u0da3","\u0da4","\u0da5","\u0da6","\u0da7","\u0da8","\u0da9","\u0daa","\u0dab","\u0dac","\u0dad","\u0dae","\u0daf","\u0db0","\u0db1","\u0db3","\u0db4","\u0db5","\u0db6","\u0db7","\u0db8","\u0db9","\u0dba","\u0dbb","\u0dbd","\u0dc0","\u0dc1","\u0dc2","\u0dc3","\u0dc4","\u0dc5","\u0dc6",["\u25cc\u0dcf","\u0dcf"],["\u25cc\u0dd0","\u0dd0"],["\u25cc\u0dd1","\u0dd1"],["\u25cc\u0dd2","\u0dd2"],["\u25cc\u0dd3","\u0dd3"],["\u25cc\u0dd4","\u0dd4"],["\u25cc\u0dd6","\u0dd6"],["\u25cc\u0dd8","\u0dd8"],["\u25cc\u0df2","\u0df2"],["\u25cc\u0ddf","\u0ddf"],["\u25cc\u0df3","\u0df3"],["\u25cc\u0dd9","\u0dd9"],["\u25cc\u0dda","\u0dda"],["\u25cc\u0ddc","\u0ddc"],["\u25cc\u0ddd","\u0ddd"],["\u25cc\u0dde","\u0dde"],["\u25cc\u0dca","\u0dca"]]},'gujarati':{'labelMsg':'wikieditor-toolbar-characters-page-gujarati','language':'gu','layout':'characters','characters':["\u0ad0","\u0a85","\u0a86","\u0a87","\u0a88","\u0a89","\u0a8a","\u0a8b","\u0ae0","\u0a8c","\u0ae1","\u0a8d","\u0a8f","\u0a90","\u0a91","\u0a93","\u0a94","\u0a95","\u0a96","\u0a97","\u0a98","\u0a99","\u0a9a","\u0a9b","\u0a9c","\u0a9d","\u0a9e","\u0a9f","\u0aa0","\u0aa1","\u0aa2","\u0aa3","\u0aa4","\u0aa5","\u0aa6","\u0aa7","\u0aa8","\u0aaa","\u0aab","\u0aac","\u0aad","\u0aae","\u0aaf","\u0ab0","\u0ab2","\u0ab5","\u0ab6","\u0ab7","\u0ab8","\u0ab9","\u0ab3","\u0abd",["\u25cc\u0abe","\u0abe"],["\u25cc\u0abf","\u0abf"],["\u25cc\u0ac0","\u0ac0"],["\u25cc\u0ac1","\u0ac1"],["\u25cc\u0ac2","\u0ac2"],["\u25cc\u0ac3","\u0ac3"],["\u25cc\u0ac4","\u0ac4"],["\u25cc\u0ae2","\u0ae2"],["\u25cc\u0ae3","\u0ae3"],["\u25cc\u0ac5","\u0ac5"],["\u25cc\u0ac7","\u0ac7"],["\u25cc\u0ac8","\u0ac8"],["\u25cc\u0ac9","\u0ac9"],["\u25cc\u0acb","\u0acb"],["\u25cc\u0acc","\u0acc"],["\u25cc\u0acd","\u0acd"]]}}},'help':{labelMsg:'wikieditor-toolbar-section-help',type:'booklet',pages:{'format':{labelMsg:'wikieditor-toolbar-help-page-format',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-italic-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-italic-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-italic-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-bold-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-bold-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-bold-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-bolditalic-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-bolditalic-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-bolditalic-result'}}]},'link':{labelMsg:'wikieditor-toolbar-help-page-link',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-ilink-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-ilink-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-ilink-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-xlink-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-xlink-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-xlink-result'}}]},'heading':{labelMsg:'wikieditor-toolbar-help-page-heading',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-heading1-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-heading1-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-heading1-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-heading2-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-heading2-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-heading2-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-heading3-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-heading3-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-heading3-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-heading4-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-heading4-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-heading4-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-heading5-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-heading5-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-heading5-result'}}]},'list':{labelMsg:'wikieditor-toolbar-help-page-list',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-ulist-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-ulist-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-ulist-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-olist-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-olist-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-olist-result'}}]},'file':{labelMsg:'wikieditor-toolbar-help-page-file',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-file-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-file-syntax'},'result':{htmlMsg:['wikieditor-toolbar-help-content-file-result',stylepath]}}]},'reference':{labelMsg:'wikieditor-toolbar-help-page-reference',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-reference-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-reference-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-reference-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-rereference-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-rereference-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-rereference-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-showreferences-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-showreferences-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-showreferences-result'}}]},'discussion':{labelMsg:'wikieditor-toolbar-help-page-discussion',layout:'table',headings:[{textMsg:'wikieditor-toolbar-help-heading-description'},{textMsg:'wikieditor-toolbar-help-heading-syntax'},{textMsg:'wikieditor-toolbar-help-heading-result'}],rows:[{'description':{htmlMsg:'wikieditor-toolbar-help-content-signaturetimestamp-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-signaturetimestamp-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-signaturetimestamp-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-signature-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-signature-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-signature-result'}},{'description':{htmlMsg:'wikieditor-toolbar-help-content-indent-description'},'syntax':{htmlMsg:'wikieditor-toolbar-help-content-indent-syntax'},'result':{htmlMsg:'wikieditor-toolbar-help-content-indent-result'}}]}}}},'dialogs':{'insert-link':{titleMsg:'wikieditor-toolbar-tool-link-title',id:'wikieditor-toolbar-link-dialog',html:'\
1010 <fieldset>\
@@ -38,7 +38,7 @@
3939 status='notexists';else if(typeof page.invalid!='undefined')
4040 status='invalid';}
4141 cache[target]=status;updateWidget(status);}}));}
42 -$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',gM('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',gM('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=gM($j(this).attr('id')+'-tooltip');if($j(this).val()=='')
 42+var u=mw.usability;$j(this).find('[rel]').each(function(){$j(this).text(u.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=u.getMsg($j(this).attr('id')+'-tooltip');if($j(this).val()=='')
4343 $j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');}).focus(function(){$j(this).removeClass('wikieditor-toolbar-dialog-hint');if($j(this).val()==$j(this).data('tooltip'))
4444 $j(this).val('');}).bind('blur change',function(){if($j(this).val()=='')
4545 $j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');else
@@ -46,7 +46,7 @@
4747 $j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else
4848 $j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched'))
4949 $j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val()).change();},0);});$j('#wikieditor-toolbar-link-int-text').bind('change keydown paste cut',function(){var oldVal=$j(this).val();var that=this;setTimeout(function(){if($j(that).val()!=oldVal)
50 -$j(that).data('untouched',false);},0);});var existsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=gM('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=gM('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=gM('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-exists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-exists.png')).append(existsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-notexists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-notexists.png')).append(notexistsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-invalid').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-invalid.png')).append(invalidMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-external').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-external.png')).append(externalMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-loading').append($j('<img />').attr({'src':$j.wikiEditor.imgPath+'dialogs/'+'loading.gif','alt':loadingMsg,'title':loadingMsg}))).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keypress paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
 50+$j(that).data('untouched',false);},0);});var existsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-exists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-exists.png')).append(existsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-notexists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-notexists.png')).append(notexistsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-invalid').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-invalid.png')).append(invalidMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-external').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-external.png')).append(externalMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-loading').append($j('<img />').attr({'src':$j.wikiEditor.imgPath+'dialogs/'+'loading.gif','alt':loadingMsg,'title':loadingMsg}))).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keypress paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
5151 var timerID=setTimeout(updateExistence,120);$j(this).data('timerID',timerID);}).change(function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
5252 updateExistence();});$j('#wikieditor-toolbar-link-int-target').data('suggcache',{}).suggestions({fetch:function(query){var that=this;var title=$j(this).val();if(isExternalLink(title)||title.indexOf('|')!=-1||title==''){$j(this).suggestions('suggestions',[]);return;}
5353 var cache=$j(this).data('suggcache');if(typeof cache[title]!='undefined'){$j(this).suggestions('suggestions',cache[title]);return;}
@@ -54,13 +54,13 @@
5555 request.abort();}});},dialog:{width:500,buttons:{'wikieditor-toolbar-tool-link-insert':function(){function escapeInternalText(s){return s.replace(/(]{2,})/g,'<nowiki>$1</nowiki>');}
5656 function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/]/g,'%5D');}
5757 function escapeExternalText(s){return s.replace(/(]+)/g,'<nowiki>$1</nowiki>');}
58 -var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();if(target==''){alert(gM('wikieditor-toolbar-tool-link-empty'));return;}
 58+var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();var u=mw.usability;if(target==''){alert(u.getMsg('wikieditor-toolbar-tool-link-empty'));return;}
5959 if($j.trim(text)==''){text='';}
60 -if($j('#wikieditor-toolbar-link-type-int').is(':checked')){if($j('#wikieditor-toolbar-link-int-target-status-invalid').is(':visible')){alert(gM('wikieditor-toolbar-tool-link-int-invalid'));return;}
 60+if($j('#wikieditor-toolbar-link-type-int').is(':checked')){if($j('#wikieditor-toolbar-link-int-target-status-invalid').is(':visible')){alert(u.getMsg('wikieditor-toolbar-tool-link-int-invalid'));return;}
6161 if(target==text)
6262 insertText='[['+target+']]';else
6363 insertText='[['+target+'|'+escapeInternalText(text)+']]';}else{if(!target.match(/^[a-z]+:\/\/./))
64 -target='http://'+target;var match=target.match($j(this).data('articlePathRegex'));if(match&&!$j(this).data('ignoreLooksInternal')){var buttons={};var that=this;buttons[gM('wikieditor-toolbar-tool-link-lookslikeinternal-int')]=function(){$j('#wikieditor-toolbar-link-int-target').val(match[1]).change();$j(this).dialog('close');};buttons[gM('wikieditor-toolbar-tool-link-lookslikeinternal-ext')]=function(){$j(that).data('ignoreLooksInternal',true);$j(that).closest('.ui-dialog').find('button:first').click();$j(that).data('ignoreLooksInternal',false);$j(this).dialog('close');};$j.wikiEditor.modules.dialogs.quickDialog(gM('wikieditor-toolbar-tool-link-lookslikeinternal',match[1]),{buttons:buttons});return;}
 64+target='http://'+target;var match=target.match($j(this).data('articlePathRegex'));if(match&&!$j(this).data('ignoreLooksInternal')){var buttons={};var that=this;buttons[u.getMsg('wikieditor-toolbar-tool-link-lookslikeinternal-int')]=function(){$j('#wikieditor-toolbar-link-int-target').val(match[1]).change();$j(this).dialog('close');};buttons[u.getMsg('wikieditor-toolbar-tool-link-lookslikeinternal-ext')]=function(){$j(that).data('ignoreLooksInternal',true);$j(that).closest('.ui-dialog').find('button:first').click();$j(that).data('ignoreLooksInternal',false);$j(this).dialog('close');};$j.wikiEditor.modules.dialogs.quickDialog(u.getMsg('wikieditor-toolbar-tool-link-lookslikeinternal',match[1]),{buttons:buttons});return;}
6565 var escTarget=escapeExternalTarget(target);var escText=escapeExternalText(text);if(escTarget==escText)
6666 insertText=escTarget;else if(text=='')
6767 insertText='['+escTarget+']';else
@@ -127,12 +127,12 @@
128128 </tr>\
129129 </table>\
130130 </div>\
131 - </div></div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-table-dimensions-rows').val(4);$j('#wikieditor-toolbar-table-dimensions-columns').val(3);$j('#wikieditor-toolbar-table-wikitable').click(function(){$j('.wikieditor-toolbar-table-preview').toggleClass('wikitable');});$j('#wikieditor-toolbar-table-preview').clone().attr('id','wikieditor-toolbar-table-preview2').addClass('sortable').insertAfter($j('#wikieditor-toolbar-table-preview')).hide();if(typeof ts_makeSortable=='function')
 131+ </div></div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-table-dimensions-rows').val(4);$j('#wikieditor-toolbar-table-dimensions-columns').val(3);$j('#wikieditor-toolbar-table-wikitable').click(function(){$j('.wikieditor-toolbar-table-preview').toggleClass('wikitable');});$j('#wikieditor-toolbar-table-preview').clone().attr('id','wikieditor-toolbar-table-preview2').addClass('sortable').insertAfter($j('#wikieditor-toolbar-table-preview')).hide();if(typeof ts_makeSortable=='function')
132132 ts_makeSortable($j('#wikieditor-toolbar-table-preview2').get(0));$j('#wikieditor-toolbar-table-sortable').click(function(){$j('#wikieditor-toolbar-table-preview').hide().attr('id','wikieditor-toolbar-table-preview3');$j('#wikieditor-toolbar-table-preview2').attr('id','wikieditor-toolbar-table-preview').show();$j('#wikieditor-toolbar-table-preview3').attr('id','wikieditor-toolbar-table-preview2');});$j('#wikieditor-toolbar-table-dimensions-header').click(function(){var headerHTML=$j('.wikieditor-toolbar-table-preview-header').html();var hiddenHTML=$j('.wikieditor-toolbar-table-preview-hidden').html();$j('.wikieditor-toolbar-table-preview-header').html(hiddenHTML);$j('.wikieditor-toolbar-table-preview-hidden').html(headerHTML);if(typeof ts_makeSortable=='function')
133 -ts_makeSortable($j('#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2').filter('.sortable').get(0));});},dialog:{resizable:false,width:590,buttons:{'wikieditor-toolbar-tool-table-insert':function(){var rowsVal=$j('#wikieditor-toolbar-table-dimensions-rows').val();var colsVal=$j('#wikieditor-toolbar-table-dimensions-columns').val();var rows=parseInt(rowsVal,10);var cols=parseInt(colsVal,10);var header=Math.min(1,$j('#wikieditor-toolbar-table-dimensions-header:checked').size());if(isNaN(rows)||isNaN(cols)||rows!=rowsVal||cols!=colsVal){alert(gM('wikieditor-toolbar-tool-table-invalidnumber'));return;}
134 -if(rows+header==0||cols==0){alert(gM('wikieditor-toolbar-tool-table-zero'));return;}
135 -if(rows*cols>1000){alert(gM('wikieditor-toolbar-tool-table-toomany',1000));return;}
136 -var headerText=gM('wikieditor-toolbar-tool-table-example-header');var normalText=gM('wikieditor-toolbar-tool-table-example');var table="";for(var r=0;r<rows+header;r++){table+="|-\n";for(var c=0;c<cols;c++){var isHeader=(r+1==header);var delim=isHeader?'!':'|';if(c>0){delim+=delim;}
 133+ts_makeSortable($j('#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2').filter('.sortable').get(0));});},dialog:{resizable:false,width:590,buttons:{'wikieditor-toolbar-tool-table-insert':function(){var rowsVal=$j('#wikieditor-toolbar-table-dimensions-rows').val();var colsVal=$j('#wikieditor-toolbar-table-dimensions-columns').val();var rows=parseInt(rowsVal,10);var cols=parseInt(colsVal,10);var header=Math.min(1,$j('#wikieditor-toolbar-table-dimensions-header:checked').size());var u=mw.usability;if(isNaN(rows)||isNaN(cols)||rows!=rowsVal||cols!=colsVal){alert(u.getMsg('wikieditor-toolbar-tool-table-invalidnumber'));return;}
 134+if(rows+header==0||cols==0){alert(u.getMsg('wikieditor-toolbar-tool-table-zero'));return;}
 135+if(rows*cols>1000){alert(u.getMsg('wikieditor-toolbar-tool-table-toomany',1000));return;}
 136+var headerText=u.getMsg('wikieditor-toolbar-tool-table-example-header');var normalText=u.getMsg('wikieditor-toolbar-tool-table-example');var table="";for(var r=0;r<rows+header;r++){table+="|-\n";for(var c=0;c<cols;c++){var isHeader=(r+1==header);var delim=isHeader?'!':'|';if(c>0){delim+=delim;}
137137 table+=delim+' '+(isHeader?headerText:normalText)+' ';}
138138 table=table.substr(0,table.length-1)+"\n";}
139139 var classes=[];if($j('#wikieditor-toolbar-table-wikitable').is(':checked'))
@@ -164,16 +164,16 @@
165165 <input type="checkbox" id="wikieditor-toolbar-replace-regex" />\
166166 <label for="wikieditor-toolbar-replace-regex" rel="wikieditor-toolbar-tool-replace-regex"></label>\
167167 </div>\
168 - </fieldset>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j(this).data('replaceCallback',function(mode){$j('#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex').hide();var searchStr=$j('#wikieditor-toolbar-replace-search').val();if(searchStr==''){$j('#wikieditor-toolbar-replace-emptysearch').show();return;}
 168+ </fieldset>',init:function(){var u=mw.usability;$j(this).find('[rel]').each(function(){$j(this).text(u.getMsg($j(this).attr('rel')));});$j(this).data('replaceCallback',function(mode){$j('#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex').hide();var searchStr=$j('#wikieditor-toolbar-replace-search').val();if(searchStr==''){$j('#wikieditor-toolbar-replace-emptysearch').show();return;}
169169 var replaceStr=$j('#wikieditor-toolbar-replace-replace').val();var flags='m';var matchCase=$j('#wikieditor-toolbar-replace-case').is(':checked');var isRegex=$j('#wikieditor-toolbar-replace-regex').is(':checked');if(!matchCase){flags+='i';}
170170 if(mode=='replaceAll'){flags+='g';}
171171 if(!isRegex){searchStr=RegExp.escape(searchStr);}
172 -try{var regex=new RegExp(searchStr,flags);}catch(e){$j('#wikieditor-toolbar-replace-invalidregex').text(gM('wikieditor-toolbar-tool-replace-invalidregex',e.message)).show();return;}
 172+try{var regex=new RegExp(searchStr,flags);}catch(e){$j('#wikieditor-toolbar-replace-invalidregex').text(u.getMsg('wikieditor-toolbar-tool-replace-invalidregex',e.message)).show();return;}
173173 var $textarea=$j(this).data('context').$textarea;var text=$textarea.textSelection('getContents');var match=false;var offset,s;if(mode!='replaceAll'){offset=$j(this).data('offset');s=text.substr(offset);match=s.match(regex);}
174174 if(!match){offset=0;s=text;match=s.match(regex);}
175175 if(!match){$j('#wikieditor-toolbar-replace-nomatch').show();}else if(mode=='replaceAll'){var index;for(var i=0;i<match.length;i++){index=s.indexOf(match[i]);if(index==-1){break;}
176176 s=s.substr(index+match[i].length);var start=index+offset;var end=start+match[i].length;var newEnd=start+replaceStr.length;$textarea.textSelection('setSelection',{'start':start,'end':end}).textSelection('encapsulateSelection',{'peri':replaceStr,'replace':true}).textSelection('setSelection',{'start':start,'end':newEnd});offset=newEnd;}
177 -$j('#wikieditor-toolbar-replace-success').text(gM('wikieditor-toolbar-tool-replace-success',match.length)).show();$j(this).data('offset',0);}else{var start=match.index+offset;var end=start+match[0].length;var newEnd=start+replaceStr.length;$textarea.textSelection('setSelection',{'start':start,'end':end});if(mode=='replace'){$textarea.textSelection('encapsulateSelection',{'peri':replaceStr,'replace':true}).textSelection('setSelection',{'start':start,'end':newEnd});}
 177+$j('#wikieditor-toolbar-replace-success').text(u.getMsg('wikieditor-toolbar-tool-replace-success',match.length)).show();$j(this).data('offset',0);}else{var start=match.index+offset;var end=start+match[0].length;var newEnd=start+replaceStr.length;$textarea.textSelection('setSelection',{'start':start,'end':end});if(mode=='replace'){$textarea.textSelection('encapsulateSelection',{'peri':replaceStr,'replace':true}).textSelection('setSelection',{'start':start,'end':newEnd});}
178178 $textarea.textSelection('scrollToCaretPosition');$j(this).data('offset',mode=='replace'?newEnd:end);}});},dialog:{width:500,buttons:{'wikieditor-toolbar-tool-replace-button-findnext':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'find');},'wikieditor-toolbar-tool-replace-button-replacenext':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'replace');},'wikieditor-toolbar-tool-replace-button-replaceall':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'replaceAll');},'wikieditor-toolbar-tool-replace-close':function(){$j(this).dialog('close');}},open:function(){$j(this).data('offset',0);$j('#wikieditor-toolbar-replace-search').focus();$j('#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex').hide();if(!($j(this).data('onetimeonlystuff'))){$j(this).data('onetimeonlystuff',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);});}
179 -var dialog=$j(this).closest('.ui-dialog');var that=this;$j($j(this).data('context').$iframe[0].contentWindow.document).bind('keypress.srdialog',function(e){if((e.keyCode||e.which)==13){var button=dialog.data('dialogaction')||dialog.find('button:first');button.click();e.preventDefault();}else if((e.keyCode||e.which)==27){$j(that).dialog('close');}});},close:function(){$j($j(this).data('context').$iframe[0].contentWindow.document).unbind('keypress.srdialog');$j(this).data('context').$iframe[0].contentWindow.focus();$j(this).closest('.ui-dialog').data('dialogaction',false);}}}}});}});mw.ready(function(){if(!wgWikiEditorEnabledModules.templateEditor){return true;}
 179+var dialog=$j(this).closest('.ui-dialog');var that=this;$j($j(this).data('context').$iframe[0].contentWindow.document).bind('keypress.srdialog',function(e){if((e.keyCode||e.which)==13){var button=dialog.data('dialogaction')||dialog.find('button:first');button.click();e.preventDefault();}else if((e.keyCode||e.which)==27){$j(that).dialog('close');}});},close:function(){$j($j(this).data('context').$iframe[0].contentWindow.document).unbind('keypress.srdialog');$j(this).data('context').$iframe[0].contentWindow.focus();$j(this).closest('.ui-dialog').data('dialogaction',false);}}}}});}});$j(document).ready(function(){if(!wgWikiEditorEnabledModules.templateEditor){return true;}
180180 if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','templateEditor');}});
\ No newline at end of file
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Preview/Preview.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Preview module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for preview
66 if ( !wgWikiEditorEnabledModules.preview ) {
77 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Template Editor module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for templateEditor
66 if ( !wgWikiEditorEnabledModules.templateEditor ) {
77 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Toolbar module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for toolbar
66 if ( !wgWikiEditorEnabledModules.toolbar ) {
77 return true;
@@ -960,17 +960,18 @@
961961 );
962962 }
963963 // Set labels of tabs based on rel values
 964+ var u = mw.usability;
964965 $j(this).find( '[rel]' ).each( function() {
965 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 966+ $j(this).text( u.getMsg( $j(this).attr( 'rel' ) ) );
966967 });
967968 // Setup the tooltips in the textboxes
968969 $j( '#wikieditor-toolbar-link-int-target' )
969 - .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
 970+ .data( 'tooltip', u.getMsg( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
970971 $j( '#wikieditor-toolbar-link-int-text' )
971 - .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
 972+ .data( 'tooltip', u.getMsg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
972973 $j( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' )
973974 .each( function() {
974 - var tooltip = gM( $j( this ).attr( 'id' ) + '-tooltip' );
 975+ var tooltip = u.getMsg( $j( this ).attr( 'id' ) + '-tooltip' );
975976 if ( $j( this ).val() == '' )
976977 $j( this )
977978 .val( $j( this ).data( 'tooltip' ) )
@@ -1019,11 +1020,11 @@
10201021 });
10211022 // Add images to the page existence widget, which will be shown mutually exclusively to communicate if the
10221023 // page exists, does not exist or the title is invalid (like if it contains a | character)
1023 - var existsMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-exists' );
1024 - var notexistsMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-notexists' );
1025 - var invalidMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-invalid' );
1026 - var externalMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-external' );
1027 - var loadingMsg = gM( 'wikieditor-toolbar-tool-link-int-target-status-loading' );
 1024+ var existsMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-exists' );
 1025+ var notexistsMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-notexists' );
 1026+ var invalidMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-invalid' );
 1027+ var externalMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-external' );
 1028+ var loadingMsg = u.getMsg( 'wikieditor-toolbar-tool-link-int-target-status-loading' );
10281029 $j( '#wikieditor-toolbar-link-int-target-status' )
10291030 .append( $j( '<div />' )
10301031 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' )
@@ -1139,8 +1140,9 @@
11401141 var whitespace = $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace' );
11411142 var target = $j( '#wikieditor-toolbar-link-int-target' ).val();
11421143 var text = $j( '#wikieditor-toolbar-link-int-text' ).val();
 1144+ var u = mw.usability;
11431145 if ( target == '' ) {
1144 - alert( gM( 'wikieditor-toolbar-tool-link-empty' ) );
 1146+ alert( u.getMsg( 'wikieditor-toolbar-tool-link-empty' ) );
11451147 return;
11461148 }
11471149 if ( $j.trim( text ) == '' ) {
@@ -1152,7 +1154,7 @@
11531155 // FIXME: Exactly how fragile is this?
11541156 if ( $j( '#wikieditor-toolbar-link-int-target-status-invalid' ).is( ':visible' ) ) {
11551157 // Refuse to add links to invalid titles
1156 - alert( gM( 'wikieditor-toolbar-tool-link-int-invalid' ) );
 1158+ alert( u.getMsg( 'wikieditor-toolbar-tool-link-int-invalid' ) );
11571159 return;
11581160 }
11591161
@@ -1170,18 +1172,18 @@
11711173 if ( match && !$j(this).data( 'ignoreLooksInternal' ) ) {
11721174 var buttons = { };
11731175 var that = this;
1174 - buttons[ gM( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = function() {
 1176+ buttons[ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = function() {
11751177 $j( '#wikieditor-toolbar-link-int-target' ).val( match[1] ).change();
11761178 $j(this).dialog( 'close' );
11771179 };
1178 - buttons[ gM( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = function() {
 1180+ buttons[ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = function() {
11791181 $j(that).data( 'ignoreLooksInternal', true );
11801182 $j(that).closest( '.ui-dialog' ).find( 'button:first' ).click();
11811183 $j(that).data( 'ignoreLooksInternal', false );
11821184 $j(this).dialog( 'close' );
11831185 };
11841186 $j.wikiEditor.modules.dialogs.quickDialog(
1185 - gM( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ),
 1187+ u.getMsg( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ),
11861188 { buttons: buttons }
11871189 );
11881190 return;
@@ -1350,7 +1352,7 @@
13511353 </div></div>',
13521354 init: function() {
13531355 $j(this).find( '[rel]' ).each( function() {
1354 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 1356+ $j(this).text( mw.usability.getMsg( $j(this).attr( 'rel' ) ) );
13551357 });
13561358 $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
13571359 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
@@ -1407,20 +1409,21 @@
14081410 var rows = parseInt( rowsVal, 10 );
14091411 var cols = parseInt( colsVal, 10 );
14101412 var header = Math.min( 1, $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).size() );
 1413+ var u = mw.usability;
14111414 if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
1412 - alert( gM( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
 1415+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
14131416 return;
14141417 }
14151418 if ( rows + header == 0 || cols == 0 ) {
1416 - alert( gM( 'wikieditor-toolbar-tool-table-zero' ) );
 1419+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-zero' ) );
14171420 return;
14181421 }
14191422 if ( rows * cols > 1000 ) {
1420 - alert( gM( 'wikieditor-toolbar-tool-table-toomany', 1000 ) );
 1423+ alert( u.getMsg( 'wikieditor-toolbar-tool-table-toomany', 1000 ) );
14211424 return;
14221425 }
1423 - var headerText = gM( 'wikieditor-toolbar-tool-table-example-header' );
1424 - var normalText = gM( 'wikieditor-toolbar-tool-table-example' );
 1426+ var headerText = u.getMsg( 'wikieditor-toolbar-tool-table-example-header' );
 1427+ var normalText = u.getMsg( 'wikieditor-toolbar-tool-table-example' );
14251428 var table = "";
14261429 for ( var r = 0; r < rows + header; r++ ) {
14271430 table += "|-\n";
@@ -1526,8 +1529,9 @@
15271530 </div>\
15281531 </fieldset>',
15291532 init: function() {
 1533+ var u = mw.usability;
15301534 $j(this).find( '[rel]' ).each( function() {
1531 - $j(this).text( gM( $j(this).attr( 'rel' ) ) );
 1535+ $j(this).text( u.getMsg( $j(this).attr( 'rel' ) ) );
15321536 });
15331537
15341538 // TODO: Find a cleaner way to share this function
@@ -1555,7 +1559,7 @@
15561560 var regex = new RegExp( searchStr, flags );
15571561 } catch( e ) {
15581562 $j( '#wikieditor-toolbar-replace-invalidregex' )
1559 - .text( gM( 'wikieditor-toolbar-tool-replace-invalidregex',
 1563+ .text( u.getMsg( 'wikieditor-toolbar-tool-replace-invalidregex',
15601564 e.message ) )
15611565 .show();
15621566 return;
@@ -1604,7 +1608,7 @@
16051609 offset = newEnd;
16061610 }
16071611 $j( '#wikieditor-toolbar-replace-success' )
1608 - .text( gM( 'wikieditor-toolbar-tool-replace-success', match.length ) )
 1612+ .text( u.getMsg( 'wikieditor-toolbar-tool-replace-success', match.length ) )
16091613 .show();
16101614 $j(this).data( 'offset', 0 );
16111615 } else {
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toc/Toc.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Toc module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for toolbar
66 if ( !wgWikiEditorPreferences || !( wgWikiEditorPreferences.toc && wgWikiEditorPreferences.toc.enable ) ) {
77 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Publish/Publish.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Publish module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for publish
66 if ( !wgWikiEditorEnabledModules.publish ) {
77 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Highlight/Highlight.js
@@ -1,6 +1,6 @@
22 /* JavaScript for WikiEditor Highlight module */
33
4 -mw.ready( function() {
 4+$j(document).ready( function() {
55 // Check preferences for highlight
66 if ( !wgWikiEditorEnabledModules.highlight ) {
77 return true;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -12,18 +12,18 @@
1313
1414 static $scripts = array(
1515 'raw' => array(
16 - array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 4 ),
17 - array( 'src' => 'Modules/Preview/Preview.js', 'version' => 5 ),
18 - array( 'src' => 'Modules/Publish/Publish.js', 'version' => 5 ),
19 - array( 'src' => 'Modules/Toc/Toc.js', 'version' => 6 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 36 ),
21 - array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 3 ),
 16+ array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 5 ),
 17+ array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
 18+ array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
 19+ array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 37 ),
 21+ array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 38 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 39 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 38 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 39 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/js/usability.js
@@ -0,0 +1,45 @@
 2+/**
 3+ * Common version-independent functions
 4+ */
 5+
 6+if ( typeof mw == 'undefined' ) {
 7+ mw = {};
 8+}
 9+
 10+mw.usability = {
 11+ messages: {}
 12+}
 13+
 14+/**
 15+ * This may eventually load something instead of just calling the callback.
 16+ */
 17+mw.usability.load = function( deps, callback ) {
 18+ callback();
 19+};
 20+
 21+/**
 22+ * Add messages to a local message table
 23+ */
 24+mw.usability.addMessages = function( messages ) {
 25+ for ( var key in messages ) {
 26+ this.messages[key] = messages[key];
 27+ }
 28+};
 29+
 30+/**
 31+ * Get a message
 32+ */
 33+mw.usability.getMsg = function( key, args ) {
 34+ if ( !( key in this.messages ) ) {
 35+ return '[' + key + ']';
 36+ }
 37+ var msg = this.messages[key];
 38+ if ( typeof args == 'object' || typeof args == 'array' ) {
 39+ for ( var argKey in args ) {
 40+ msg = msg.replace( '\$' + (parseInt( argKey ) + 1), args[argKey] );
 41+ }
 42+ } else if ( typeof args == 'string' || typeof args == 'number' ) {
 43+ msg = msg.replace( '$1', args );
 44+ }
 45+ return msg;
 46+};
Property changes on: trunk/extensions/UsabilityInitiative/js/usability.js
___________________________________________________________________
Added: svn:eol-style
147 + native
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -106,9 +106,8 @@
107107 return $.wikiEditor.supported = true;
108108 },
109109 /**
110 - * Provides a way to extract messages from objects. Wraps the gM function from js2stopgap.js, which will be changing
111 - * in the very near future, so let's keep and eye on this. It's also possible that this function will just be moved
112 - * to the global mw object all together.
 110+ * Provides a way to extract messages from objects. Wraps the mw.usability.getMsg() function, which
 111+ * may eventually become a wrapper for some kind of core MW functionality.
113112 *
114113 * @param object Object to extract messages from
115114 * @param property String of name of property which contains the message. This should be the base name of the
@@ -131,9 +130,9 @@
132131 } else if ( property + 'Msg' in object ) {
133132 if ( typeof object[property + 'Msg' ] == 'object' ) {
134133 // [ messageKey, arg1, arg2, ... ]
135 - return gM.apply( this, object[property + 'Msg' ] );
 134+ return mw.usability.getMsg.apply( mw.usability, object[property + 'Msg' ] );
136135 } else {
137 - return gM( object[property + 'Msg'] );
 136+ return mw.usability.getMsg( object[property + 'Msg'] );
138137 }
139138 } else {
140139 return '';
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -231,7 +231,8 @@
232232 var parts = { 'pre' : '', 'peri' : '', 'post' : '' };
233233 for ( part in parts ) {
234234 if ( part + 'Msg' in action.options ) {
235 - parts[part] = gM( action.options[part + 'Msg'], ( action.options[part] || null ) );
 235+ parts[part] = mw.usability.getMsg(
 236+ action.options[part + 'Msg'], ( action.options[part] || null ) );
236237 } else {
237238 parts[part] = ( action.options[part] || '' )
238239 }
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.publish.js
@@ -42,7 +42,7 @@
4343 </div>',
4444 init: function() {
4545 $(this).find( '[rel]' ).each( function() {
46 - $(this).text( gM( $(this).attr( 'rel' ) ) );
 46+ $(this).text( mw.usability.getMsg( $(this).attr( 'rel' ) ) );
4747 });
4848 $(this).find( '.wikiEditor-dialog-copywarn' )
4949 .html( $( '#editpage-copywarn' ).html() );
@@ -105,4 +105,4 @@
106106 }
107107 }
108108
109 -}; } )( jQuery );
\ No newline at end of file
 109+}; } )( jQuery );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.preview.js
@@ -121,7 +121,7 @@
122122 }
123123 } );
124124
125 - var loadingMsg = gM( 'wikieditor-preview-loading' );
 125+ var loadingMsg = mw.usability.getMsg( 'wikieditor-preview-loading' );
126126 context.modules.preview.$preview
127127 .add( context.$changesTab )
128128 .append( $( '<div />' )
@@ -148,4 +148,4 @@
149149 }
150150 }
151151
152 -}; } )( jQuery );
\ No newline at end of file
 152+}; } )( jQuery );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -43,7 +43,7 @@
4444 $.wikiEditor.modules.dialogs.modules[module] = config[module];
4545 }
4646 // Build out modules immediately
47 - mw.load( ['$j.ui', '$j.ui.dialog', '$j.ui.draggable', '$j.ui.resizable' ], function() {
 47+ mw.usability.load( ['$j.ui', '$j.ui.dialog', '$j.ui.draggable', '$j.ui.resizable' ], function() {
4848 for ( module in $.wikiEditor.modules.dialogs.modules ) {
4949 var module = $.wikiEditor.modules.dialogs.modules[module];
5050 // Only create the dialog if it doesn't exist yet
@@ -56,10 +56,10 @@
5757 configuration.title = $.wikiEditor.autoMsg( module, 'title' );
5858 // Transform messages in keys
5959 // Stupid JS won't let us do stuff like
60 - // foo = { gM ('bar'): baz }
 60+ // foo = { mw.usability.getMsg ('bar'): baz }
6161 configuration.newButtons = {};
6262 for ( msg in configuration.buttons )
63 - configuration.newButtons[gM( msg )] = configuration.buttons[msg];
 63+ configuration.newButtons[mw.usability.getMsg( msg )] = configuration.buttons[msg];
6464 configuration.buttons = configuration.newButtons;
6565 // Create the dialog <div>
6666 var dialogDiv = $( '<div /> ' )
@@ -148,4 +148,4 @@
149149 .dialog( 'open' );
150150 }
151151
152 -}; } ) ( jQuery );
\ No newline at end of file
 152+}; } ) ( jQuery );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -428,7 +428,7 @@
429429 context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc' ); return false;
430430 } )
431431 .find( 'a' )
432 - .text( gM( 'wikieditor-toc-hide' ) );
 432+ .text( mw.usability.getMsg( 'wikieditor-toc-hide' ) );
433433 $expandControl
434434 .addClass( 'wikiEditor-ui-toc-expandControl' )
435435 .append( '<a href="#" />' )
@@ -437,7 +437,7 @@
438438 } )
439439 .hide()
440440 .find( 'a' )
441 - .text( gM( 'wikieditor-toc-show' ) );
 441+ .text( mw.usability.getMsg( 'wikieditor-toc-show' ) );
442442 $collapseControl.insertBefore( context.modules.toc.$toc );
443443 context.$ui.find( '.wikiEditor-ui-left .wikiEditor-ui-top' ).append( $expandControl );
444444 }
Index: trunk/extensions/UsabilityInitiative/js/tests/wikiEditor.toolbar.js
@@ -189,7 +189,7 @@
190190 'post': 6
191191 }
192192 };
193 -mw.ready( function() {
 193+$j(document).ready( function() {
194194 var button = $j( '<button>Run wikiEditor Tests!</button>' )
195195 .css( {
196196 'position': 'fixed',
@@ -243,4 +243,4 @@
244244 } )
245245 .appendTo( $j( 'body' ) );
246246 setTimeout( function() { button.slideDown( 'fast' ) }, 2000 );
247 -} );
\ No newline at end of file
 247+} );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1,3 +1,48 @@
 2+/**
 3+ * Common version-independent functions
 4+ */
 5+
 6+if ( typeof mw == 'undefined' ) {
 7+ mw = {};
 8+}
 9+
 10+mw.usability = {
 11+ messages: {}
 12+}
 13+
 14+/**
 15+ * This may eventually load something instead of just calling the callback.
 16+ */
 17+mw.usability.load = function( deps, callback ) {
 18+ callback();
 19+};
 20+
 21+/**
 22+ * Add messages to a local message table
 23+ */
 24+mw.usability.addMessages = function( messages ) {
 25+ for ( var key in messages ) {
 26+ this.messages[key] = messages[key];
 27+ }
 28+};
 29+
 30+/**
 31+ * Get a message
 32+ */
 33+mw.usability.getMsg = function( key, args ) {
 34+ if ( !( key in this.messages ) ) {
 35+ return '[' + key + ']';
 36+ }
 37+ var msg = this.messages[key];
 38+ if ( typeof args == 'object' || typeof args == 'array' ) {
 39+ for ( var argKey in args ) {
 40+ msg = msg.replace( '\$' + (parseInt( argKey ) + 1), args[argKey] );
 41+ }
 42+ } else if ( typeof args == 'string' || typeof args == 'number' ) {
 43+ msg = msg.replace( '$1', args );
 44+ }
 45+ return msg;
 46+};
247 /*
348 * jQuery UI 1.7.1
449 *
@@ -6485,9 +6530,8 @@
64866531 return $.wikiEditor.supported = true;
64876532 },
64886533 /**
6489 - * Provides a way to extract messages from objects. Wraps the gM function from js2stopgap.js, which will be changing
6490 - * in the very near future, so let's keep and eye on this. It's also possible that this function will just be moved
6491 - * to the global mw object all together.
 6534+ * Provides a way to extract messages from objects. Wraps the mw.usability.getMsg() function, which
 6535+ * may eventually become a wrapper for some kind of core MW functionality.
64926536 *
64936537 * @param object Object to extract messages from
64946538 * @param property String of name of property which contains the message. This should be the base name of the
@@ -6510,9 +6554,9 @@
65116555 } else if ( property + 'Msg' in object ) {
65126556 if ( typeof object[property + 'Msg' ] == 'object' ) {
65136557 // [ messageKey, arg1, arg2, ... ]
6514 - return gM.apply( this, object[property + 'Msg' ] );
 6558+ return mw.usability.getMsg.apply( mw.usability, object[property + 'Msg' ] );
65156559 } else {
6516 - return gM( object[property + 'Msg'] );
 6560+ return mw.usability.getMsg( object[property + 'Msg'] );
65176561 }
65186562 } else {
65196563 return '';
@@ -7402,7 +7446,7 @@
74037447 $.wikiEditor.modules.dialogs.modules[module] = config[module];
74047448 }
74057449 // Build out modules immediately
7406 - mw.load( ['$j.ui', '$j.ui.dialog', '$j.ui.draggable', '$j.ui.resizable' ], function() {
 7450+ mw.usability.load( ['$j.ui', '$j.ui.dialog', '$j.ui.draggable', '$j.ui.resizable' ], function() {
74077451 for ( module in $.wikiEditor.modules.dialogs.modules ) {
74087452 var module = $.wikiEditor.modules.dialogs.modules[module];
74097453 // Only create the dialog if it doesn't exist yet
@@ -7415,10 +7459,10 @@
74167460 configuration.title = $.wikiEditor.autoMsg( module, 'title' );
74177461 // Transform messages in keys
74187462 // Stupid JS won't let us do stuff like
7419 - // foo = { gM ('bar'): baz }
 7463+ // foo = { mw.usability.getMsg ('bar'): baz }
74207464 configuration.newButtons = {};
74217465 for ( msg in configuration.buttons )
7422 - configuration.newButtons[gM( msg )] = configuration.buttons[msg];
 7466+ configuration.newButtons[mw.usability.getMsg( msg )] = configuration.buttons[msg];
74237467 configuration.buttons = configuration.newButtons;
74247468 // Create the dialog <div>
74257469 var dialogDiv = $( '<div /> ' )
@@ -7507,7 +7551,8 @@
75087552 .dialog( 'open' );
75097553 }
75107554
7511 -}; } ) ( jQuery );/* Highlight module for wikiEditor */
 7555+}; } ) ( jQuery );
 7556+/* Highlight module for wikiEditor */
75127557 ( function( $ ) { $.wikiEditor.modules.highlight = {
75137558
75147559 /**
@@ -7923,7 +7968,7 @@
79247969 }
79257970 } );
79267971
7927 - var loadingMsg = gM( 'wikieditor-preview-loading' );
 7972+ var loadingMsg = mw.usability.getMsg( 'wikieditor-preview-loading' );
79287973 context.modules.preview.$preview
79297974 .add( context.$changesTab )
79307975 .append( $( '<div />' )
@@ -7950,7 +7995,8 @@
79517996 }
79527997 }
79537998
7954 -}; } )( jQuery );/* Publish module for wikiEditor */
 7999+}; } )( jQuery );
 8000+/* Publish module for wikiEditor */
79558001 ( function( $ ) { $.wikiEditor.modules.publish = {
79568002
79578003 /**
@@ -7994,7 +8040,7 @@
79958041 </div>',
79968042 init: function() {
79978043 $(this).find( '[rel]' ).each( function() {
7998 - $(this).text( gM( $(this).attr( 'rel' ) ) );
 8044+ $(this).text( mw.usability.getMsg( $(this).attr( 'rel' ) ) );
79998045 });
80008046 $(this).find( '.wikiEditor-dialog-copywarn' )
80018047 .html( $( '#editpage-copywarn' ).html() );
@@ -8057,7 +8103,8 @@
80588104 }
80598105 }
80608106
8061 -}; } )( jQuery );/* TemplateEditor module for wikiEditor */
 8107+}; } )( jQuery );
 8108+/* TemplateEditor module for wikiEditor */
80628109 ( function( $ ) { $.wikiEditor.modules.templateEditor = {
80638110
80648111 /**
@@ -9102,7 +9149,7 @@
91039150 context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc' ); return false;
91049151 } )
91059152 .find( 'a' )
9106 - .text( gM( 'wikieditor-toc-hide' ) );
 9153+ .text( mw.usability.getMsg( 'wikieditor-toc-hide' ) );
91079154 $expandControl
91089155 .addClass( 'wikiEditor-ui-toc-expandControl' )
91099156 .append( '<a href="#" />' )
@@ -9111,7 +9158,7 @@
91129159 } )
91139160 .hide()
91149161 .find( 'a' )
9115 - .text( gM( 'wikieditor-toc-show' ) );
 9162+ .text( mw.usability.getMsg( 'wikieditor-toc-show' ) );
91169163 $collapseControl.insertBefore( context.modules.toc.$toc );
91179164 context.$ui.find( '.wikiEditor-ui-left .wikiEditor-ui-top' ).append( $expandControl );
91189165 }
@@ -9476,7 +9523,8 @@
94779524 var parts = { 'pre' : '', 'peri' : '', 'post' : '' };
94789525 for ( part in parts ) {
94799526 if ( part + 'Msg' in action.options ) {
9480 - parts[part] = gM( action.options[part + 'Msg'], ( action.options[part] || null ) );
 9527+ parts[part] = mw.usability.getMsg(
 9528+ action.options[part + 'Msg'], ( action.options[part] || null ) );
94819529 } else {
94829530 parts[part] = ( action.options[part] || '' )
94839531 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -1,4 +1,9 @@
2 -;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;}
 2+
 3+if(typeof mw=='undefined'){mw={};}
 4+mw.usability={messages:{}}
 5+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+']';}
 6+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;}
38 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;}
49 var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
510 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));};}
@@ -433,7 +438,7 @@
434439 if(!($.browser.name in $.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'])){return $.wikiEditor.supported=true;}
435440 var browser=$.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return $.wikiEditor.supported=false;}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return $.wikiEditor.supported=false;}}}
436441 return $.wikiEditor.supported=true;},'autoMsg':function(object,property){if(typeof property=='object'){for(i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}}
437 -if(property in object){return object[property];}else if(property+'Msg'in object){if(typeof object[property+'Msg']=='object'){return gM.apply(this,object[property+'Msg']);}else{return gM(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;}
 442+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;}
438443 return src+'?'+wgWikiEditorIconVersion;}};$.fn.wikiEditor=function(){if(!$j.wikiEditor.isSupported()){return $(this);}
439444 var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':$.wikiEditor.instances.push($(this))-1,'offsets':null};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;}
440445 for(module in modules){if(typeof module=='string'&&module in $.wikiEditor.modules){if('api'in $.wikiEditor.modules[module]){for(call in $.wikiEditor.modules[module].api){if(!(call in context.api)){context.api[call]=$.wikiEditor.modules[module].api[call];}}}
@@ -493,8 +498,8 @@
494499 context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('change',event);}).delayedBind(250,'keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));return context.fallbackWindowOnBeforeUnload?context.fallbackWindowOnBeforeUnload():null;}}
495500 arguments=$.makeArray(arguments);if(arguments.length>0){var call=arguments.shift();if(call in context.api){context.api[call](context,typeof arguments[0]=='undefined'?{}:arguments[0]);}}
496501 return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,data)},openDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('open');}},closeDialog:function(context,data){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(module in config){$.wikiEditor.modules.dialogs.modules[module]=config[module];}
497 -mw.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){for(module in $.wikiEditor.modules.dialogs.modules){var module=$.wikiEditor.modules.dialogs.modules[module];if($('#'+module.id).size()==0){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)
498 -configuration.newButtons[gM(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);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);});}
 502+mw.usability.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){for(module in $.wikiEditor.modules.dialogs.modules){var module=$.wikiEditor.modules.dialogs.modules[module];if($('#'+module.id).size()==0){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)
 503+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);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);});}
499504 var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI)
500505 maxTI=ti;});var tabIndex=maxTI+1;$j('.ui-dialog input, .ui-dialog button').not('[tabindex]').each(function(){$j(this).attr('tabindex',tabIndex++);});}}});},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);}
501506 $(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(jQuery);(function($){$.wikiEditor.modules.highlight={cfg:{'styleVersion':3},evt:{delayedChange:function(context,event){if(event.data.scope=='division'){$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},ready:function(context,event){$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},fn:{create:function(context,config){},divide:function(context){},isolate:function(context){return[];},strip:function(context,division){return $('<div />').html(division.html().replace(/\<br[^\>]*\>/g,"\n")).text();},scan:function(context,division){function Token(offset,label,tokenStart,match){this.offset=offset;this.label=label;this.tokenStart=tokenStart;this.match=match;}
@@ -518,7 +523,7 @@
519524 context.modules.preview.previewText=wikitext;context.modules.preview.$preview.find('.wikiEditor-preview-loading').hide();context.modules.preview.$preview.find('.wikiEditor-preview-contents').html(data.parse.text['*']).find('a:not([href^=#])').click(function(){return false;});},'json');}});context.$changesTab=context.fn.addView({'name':'changes','titleMsg':'wikieditor-preview-changes-tab','init':function(context){var wikitext=context.fn.getContents();if(context.modules.preview.changesText==wikitext){return;}
520525 context.$changesTab.find('table.diff tbody').empty();context.$changesTab.find('.wikiEditor-preview-loading').show();var postdata={'action':'parse','onlypst':'','text':wikitext,'format':'json'};$.post(wgScriptPath+'/api.php',postdata,function(data){try{var postdata2={'action':'query','indexpageids':'','prop':'revisions','titles':wgPageName,'rvdifftotext':data.parse.text['*'],'rvprop':'','format':'json'};var section=$('[name=wpSection]').val();if(section!='')
521526 postdata['rvsection']=section;$.post(wgScriptPath+'/api.php',postdata2,function(data){if($('link[href='+stylepath+'/common/diff.css]').size()==0){$('head').append($('<link />').attr({'rel':'stylesheet','type':'text/css','href':stylepath+'/common/diff.css'}));}
522 -try{var diff=data.query.pages[data.query.pageids[0]].revisions[0].diff['*'];context.$changesTab.find('table.diff tbody').html(diff);context.$changesTab.find('.wikiEditor-preview-loading').hide();context.modules.preview.changesText=wikitext;}catch(e){}},'json');}catch(e){}},'json');}});var loadingMsg=gM('wikieditor-preview-loading');context.modules.preview.$preview.add(context.$changesTab).append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));context.$changesTab.find('.wikiEditor-preview-contents').html('<table class="diff"><col class="diff-marker" /><col class="diff-content" />'+'<col class="diff-marker" /><col class="diff-content" /><tbody /></table>');}}};})(jQuery);(function($){$.wikiEditor.modules.publish={fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-dialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-dialog-title',html:'\
 527+try{var diff=data.query.pages[data.query.pageids[0]].revisions[0].diff['*'];context.$changesTab.find('table.diff tbody').html(diff);context.$changesTab.find('.wikiEditor-preview-loading').hide();context.modules.preview.changesText=wikitext;}catch(e){}},'json');}catch(e){}},'json');}});var loadingMsg=mw.usability.getMsg('wikieditor-preview-loading');context.modules.preview.$preview.add(context.$changesTab).append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));context.$changesTab.find('.wikiEditor-preview-contents').html('<table class="diff"><col class="diff-marker" /><col class="diff-content" />'+'<col class="diff-marker" /><col class="diff-content" /><tbody /></table>');}}};})(jQuery);(function($){$.wikiEditor.modules.publish={fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-dialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-dialog-title',html:'\
523528 <div class="wikiEditor-dialog-copywarn"></div>\
524529 <div class="wikiEditor-dialog-editoptions">\
525530 <form id="wikieditor-'+context.instance+'-publish-dialog-form">\
@@ -538,7 +543,7 @@
539544 <label for="wikiEditor-'+context.instance+'-dialog-watch"\
540545 rel="wikieditor-publish-dialog-watch"></label>\
541546 </form>\
542 - </div>',init:function(){$(this).find('[rel]').each(function(){$(this).text(gM($(this).attr('rel')));});$(this).find('.wikiEditor-dialog-copywarn').html($('#editpage-copywarn').html());if($('#wpMinoredit').size()==0)
 547+ </div>',init:function(){$(this).find('[rel]').each(function(){$(this).text(mw.usability.getMsg($(this).attr('rel')));});$(this).find('.wikiEditor-dialog-copywarn').html($('#editpage-copywarn').html());if($('#wpMinoredit').size()==0)
543548 $('#wikiEditor-'+context.instance+'-dialog-minor').hide();else if($('#wpMinoredit').is(':checked'))
544549 $('#wikiEditor-'+context.instance+'-dialog-minor').attr('checked','checked');if($('#wpWatchthis').size()==0)
545550 $('#wikiEditor-'+context.instance+'-dialog-watch').hide();else if($('#wpWatchthis').is(':checked'))
@@ -604,7 +609,7 @@
605610 div.html('&nbsp;');var item=$('<li />').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));}
606611 list.append(item);}
607612 return list;}
608 -function buildCollapseControls(){var $collapseControl=$('<div />'),$expandControl=$('<div />');$collapseControl.addClass('tab').addClass('tab-toc').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');return false;}).find('a').text(gM('wikieditor-toc-hide'));$expandControl.addClass('wikiEditor-ui-toc-expandControl').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('expand.wikiEditor-toc');return false;}).hide().find('a').text(gM('wikieditor-toc-show'));$collapseControl.insertBefore(context.modules.toc.$toc);context.$ui.find('.wikiEditor-ui-left .wikiEditor-ui-top').append($expandControl);}
 613+function buildCollapseControls(){var $collapseControl=$('<div />'),$expandControl=$('<div />');$collapseControl.addClass('tab').addClass('tab-toc').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');return false;}).find('a').text(mw.usability.getMsg('wikieditor-toc-hide'));$expandControl.addClass('wikiEditor-ui-toc-expandControl').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('expand.wikiEditor-toc');return false;}).hide().find('a').text(mw.usability.getMsg('wikieditor-toc-show'));$collapseControl.insertBefore(context.modules.toc.$toc);context.$ui.find('.wikiEditor-ui-left .wikiEditor-ui-top').append($expandControl);}
609614 function buildResizeControls(){context.$ui.data('resizableDone',true).find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',preventPositionLeftChange:true,minWidth:parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth),start:function(e,ui){var $this=$(this);$('<div />').addClass('wikiEditor-ui-resize-mask').css({'position':'absolute','z-index':2,'left':0,'top':0,'bottom':0,'right':0}).appendTo(context.$ui.find('.wikiEditor-ui-left'));$this.resizable('option','maxWidth',$this.parent().width()-
610615 parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth));if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);}},resize:function(e,ui){$(this).css({'width':ui.size.width,'top':'auto','height':'auto'}).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);context.fn.trigger('resize');},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();context.$content.trigger('mouseup');if(ui.size.width<=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');}else{context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});context.modules.toc.$toc.data('openWidth',ui.size.width);$.cookie('wikiEditor-'+context.instance+'-toc-width',ui.size.width);}
611616 context.fn.trigger('resize');}});var handle=$.wikiEditor.modules.toc.cfg.rtl?'w':'e';context.$ui.find('.ui-resizable-'+handle).removeClass('ui-resizable-'+handle).addClass('ui-resizable-'+(handle=='w'?'e':'w')).addClass('wikiEditor-ui-toc-resize-grip');context.modules.toc.$toc.bind('collapse.wikiEditor-toc',$.wikiEditor.modules.toc.fn.collapse).bind('expand.wikiEditor-toc',$.wikiEditor.modules.toc.fn.expand);context.modules.toc.$toc.data('openWidth',$.wikiEditor.modules.toc.cfg.defaultWidth);if($.cookie('wikiEditor-'+context.instance+'-toc-width')==0){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc',{data:context});}else if($.cookie('wikiEditor-'+context.instance+'-toc-width')>0){var initialWidth=$.cookie('wikiEditor-'+context.instance+'-toc-width');if(initialWidth<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth))
@@ -633,7 +638,7 @@
634639 i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));}
635640 step=step.parent();}
636641 rels.reverse();var id=rels.join('.');$.trackAction(id);}
637 -switch(action.type){case'replace':case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=gM(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}}
 642+switch(action.type){case'replace':case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=mw.usability.getMsg(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}}
638643 if('regex'in action.options&&'regexReplace'in action.options){var selection=context.$textarea.textSelection('getSelection');if(selection!=''&&selection.match(action.options.regex)){parts.peri=selection.replace(action.options.regex,action.options.regexReplace);parts.pre=parts.post='';}}
639644 context.$textarea.textSelection('encapsulateSelection',$.extend({},action.options,parts,{'replace':action.type=='replace'}));break;case'callback':if(typeof action.execute=='function'){action.execute(context);}
640645 break;case'dialog':context.$textarea.wikiEditor('openDialog',action.module);break;default:break;}},buildGroup:function(context,id,group){var $group=$('<div />').attr({'class':'group group-'+id,'rel':id});var label=$.wikiEditor.autoMsg(group,'label');if(label){$group.append('<div class="label">'+label+'</div>')}
Index: trunk/extensions/UsabilityInitiative/Makefile
@@ -12,6 +12,7 @@
1313 css/wikiEditor.preview.css
1414
1515 PLUGINS := \
 16+ js/usability.js\
1617 js/js2stopgap/ui.core.js\
1718 js/js2stopgap/ui.datepicker.js\
1819 js/js2stopgap/ui.dialog.js\

Follow-up revisions

RevisionCommit summaryAuthorDate
r61573UsabilityInitiative: Minor tweak for r61567: jQuery is available in ClickTrac...catrope12:24, 27 January 2010
r61608wmf-deployment: Merge (parts of) r59780, r61431, r61489, r61557, r61558, r615...catrope21:59, 27 January 2010

Status & tagging log