r51742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51741‎ | r51742 | r51743 >
Date:13:36, 11 June 2009
Author:catrope
Status:deferred
Tags:
Comment:
EditToolbar: Convert spaces in page keys to underscores
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -343,6 +343,7 @@
344344 parseCharinsert: function( charinsert ) {
345345 var retval = {};
346346 for( page in charinsert ) {
 347+ var pageKey = page.replace(/ /g, '_');
347348 var characters = [], attributes = {}, styles = {};
348349 var i = 0;
349350 for( line in charinsert[page] ) {
@@ -374,17 +375,15 @@
375376 if( charinsert[page][line][character] instanceof Array ) {
376377 tool.action.options.pre = charinsert[page][line][character][0];
377378 tool.action.options.post = charinsert[page][line][character][1];
378 - //tool.text = charinsert[page][line][chr][0] + charinsert[page][line][character][1];
379379 } else {
380380 tool.action.options.pre = charinsert[page][line][character];
381 - //tool.text = charinsert[page][line][character];
382381 }
383382 tool.text = tool.action.options.pre + tool.action.options.post;
384383 characters[i++] = tool;
385384 }
386385 characters[i++] = { type: 'break' };
387386 }
388 - retval[page] = {
 387+ retval[pageKey] = {
389388 label: page,
390389 layout: 'characters',
391390 attributes: attributes,
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php
@@ -18,7 +18,7 @@
1919 /* Configuration */
2020
2121 // Bump the version number every time you change any of the .css/.js files
22 -$wgEditToolbarStyleVersion = 3;
 22+$wgEditToolbarStyleVersion = 4;
2323
2424 // Set this to true to simply override the stock toolbar for everyone
2525 $wgEditToolbarGlobalEnable = false;

Status & tagging log