r51721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51720‎ | r51721 | r51722 >
Date:23:44, 10 June 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed bug in name of layout type. Improved the look of special characters.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -258,27 +258,32 @@
259259 }
260260 }
261261 break;
262 - case 'specialchar':
 262+ case 'characters':
263263 // Appends special character adders
264264 for ( character in section.pages[page].characters ) {
265265 switch( section.pages[page].characters[character].type ) {
266266 case 'break':
267 - pageDiv.append( $( '<br />' ) );
 267+ /*
 268+ pageDiv.append(
 269+ $( '<div />' )
 270+ .css( 'clear', 'both' )
 271+ );
 272+ */
268273 break;
269274 case 'link':
270275 var context = {
271276 'tool' : section.pages[page].characters[character],
272277 'textbox': textbox
273278 };
274 - pageDiv.append( $( '<a />' )
275 - .attr( section.pages[page].characters[character].attrs )
276 - .attr( { 'href': '#' } )
277 - .text( section.pages[page].characters[character].text )
278 - .data( 'context', context)
279 - .click( action )
280 - .click( function() { return false; } )
 279+ pageDiv.append(
 280+ $( '<a />' )
 281+ .attr( section.pages[page].characters[character].attributes )
 282+ .attr( { 'href': '#' } )
 283+ .text( section.pages[page].characters[character].text )
 284+ .data( 'context', context)
 285+ .click( action )
 286+ .click( function() { return false; } )
281287 );
282 - pageDiv.append( '&nbsp;' );
283288 break;
284289 }
285290 }
@@ -335,17 +340,17 @@
336341 parseCharinsert: function( charinsert ) {
337342 var retval = {};
338343 for( page in charinsert ) {
339 - var characters = [], attrs = {};
 344+ var characters = [], attributes = {};
340345 var i = 0;
341346 for( line in charinsert[page] ) {
342347 if( !( charinsert[page][line] instanceof Array ) ) {
343 - attrs = charinsert[page][line];
 348+ attributes = charinsert[page][line];
344349 continue;
345350 }
346 - for( chr in charinsert[page][line] ) {
 351+ for( character in charinsert[page][line] ) {
347352 var tool = {
348353 type: 'link',
349 - attrs: attrs,
 354+ attributes: attributes,
350355 text: '',
351356 action: {
352357 type: 'encapsulate',
@@ -355,13 +360,13 @@
356361 }
357362 }
358363 };
359 - if( charinsert[page][line][chr] instanceof Array ) {
360 - tool.action.options.pre = charinsert[page][line][chr][0];
361 - tool.action.options.post = charinsert[page][line][chr][1];
362 - //tool.text = charinsert[page][line][chr][0] + charinsert[page][line][chr][1];
 364+ if( charinsert[page][line][character] instanceof Array ) {
 365+ tool.action.options.pre = charinsert[page][line][character][0];
 366+ tool.action.options.post = charinsert[page][line][character][1];
 367+ //tool.text = charinsert[page][line][chr][0] + charinsert[page][line][character][1];
363368 } else {
364 - tool.action.options.pre = charinsert[page][line][chr];
365 - //tool.text = charinsert[page][line][chr];
 369+ tool.action.options.pre = charinsert[page][line][character];
 370+ //tool.text = charinsert[page][line][character];
366371 }
367372 tool.text = tool.action.options.pre + tool.action.options.post;
368373 characters[i++] = tool;
@@ -370,7 +375,7 @@
371376 }
372377 retval[page] = {
373378 label: page,
374 - layout: 'specialchar',
 379+ layout: 'characters',
375380 characters: characters
376381 };
377382 }
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.css
@@ -156,6 +156,26 @@
157157 div#edittoolbar-section-help div.page > table td.description {
158158 width: 20%;
159159 }
 160+div#edittoolbar-section-characters div.page > a {
 161+ border: solid 1px #DDDDDD;
 162+ padding: 5px;
 163+ padding-left: 8px;
 164+ padding-right: 8px;
 165+ margin-left: 5px;
 166+ margin-top: 5px;
 167+ height: 1em;
 168+ float: left;
 169+ display: block;
 170+ color: black;
 171+ text-decoration: none;
 172+}
 173+div#edittoolbar-section-characters div.page > a:hover {
 174+ background-color: white;
 175+ text-decoration: none;
 176+ border-color: #a8d7f9;
 177+}
 178+div#edittoolbar-section-characters div.page > div.character {
 179+}
160180 div#edittoolbar div.tabs > div.tab {
161181 float: left;
162182 line-height: 26px;

Status & tagging log