Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | /* Configuration */ |
20 | 20 | |
21 | 21 | // Bump the version number every time you change any of the .css/.js files |
22 | | -$wgEditToolbarStyleVersion = 2; |
| 22 | +$wgEditToolbarStyleVersion = 3; |
23 | 23 | |
24 | 24 | // Set this to true to simply override the stock toolbar for everyone |
25 | 25 | $wgEditToolbarGlobalEnable = false; |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.css |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | div#edittoolbar-section-help div.page > table td.description { |
158 | 158 | width: 20%; |
159 | 159 | } |
160 | | -div#edittoolbar-section-characters div.page > a { |
| 160 | +div#edittoolbar-section-characters div.page > div > a { |
161 | 161 | border: solid 1px #DDDDDD; |
162 | 162 | padding: 5px; |
163 | 163 | padding-left: 8px; |
— | — | @@ -169,12 +169,16 @@ |
170 | 170 | color: black; |
171 | 171 | text-decoration: none; |
172 | 172 | } |
173 | | -div#edittoolbar-section-characters div.page > a:hover { |
| 173 | +div#edittoolbar-section-characters div.page > div.rtl > a { |
| 174 | + direction: rtl; |
| 175 | + float: right; |
| 176 | +} |
| 177 | +div#edittoolbar-section-characters div.page > div > a:hover { |
174 | 178 | background-color: white; |
175 | 179 | text-decoration: none; |
176 | 180 | border-color: #a8d7f9; |
177 | 181 | } |
178 | | -div#edittoolbar-section-characters div.page > div.character { |
| 182 | +div#edittoolbar-section-characters div.page > div > div.character { |
179 | 183 | } |
180 | 184 | div#edittoolbar div.tabs > div.tab { |
181 | 185 | float: left; |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -260,6 +260,10 @@ |
261 | 261 | break; |
262 | 262 | case 'characters': |
263 | 263 | // Appends special character adders |
| 264 | + var charsDiv = $( '<div />' ) |
| 265 | + .attr( section.pages[page].attributes ) |
| 266 | + .css( section.pages[page].styles ) |
| 267 | + .appendTo( pageDiv ); |
264 | 268 | for ( character in section.pages[page].characters ) { |
265 | 269 | switch( section.pages[page].characters[character].type ) { |
266 | 270 | case 'break': |
— | — | @@ -275,10 +279,9 @@ |
276 | 280 | 'tool' : section.pages[page].characters[character], |
277 | 281 | 'textbox': textbox |
278 | 282 | }; |
279 | | - pageDiv.append( |
| 283 | + charsDiv.append( |
280 | 284 | $( '<a />' ) |
281 | | - .attr( section.pages[page].characters[character].attributes ) |
282 | | - .attr( { 'href': '#' } ) |
| 285 | + .attr( 'href', '#' ) |
283 | 286 | .text( section.pages[page].characters[character].text ) |
284 | 287 | .data( 'context', context) |
285 | 288 | .click( action ) |
— | — | @@ -340,17 +343,25 @@ |
341 | 344 | parseCharinsert: function( charinsert ) { |
342 | 345 | var retval = {}; |
343 | 346 | for( page in charinsert ) { |
344 | | - var characters = [], attributes = {}; |
| 347 | + var characters = [], attributes = {}, styles = {}; |
345 | 348 | var i = 0; |
346 | 349 | for( line in charinsert[page] ) { |
347 | 350 | if( !( charinsert[page][line] instanceof Array ) ) { |
348 | | - attributes = charinsert[page][line]; |
| 351 | + for( attr in charinsert[page][line] ) { |
| 352 | + switch( attr ) { |
| 353 | + case 'class': |
| 354 | + case 'lang': |
| 355 | + attributes[attr] = charinsert[page][line][attr]; |
| 356 | + break; |
| 357 | + default: |
| 358 | + styles[attr] = charinsert[page][line][attr]; |
| 359 | + } |
| 360 | + } |
349 | 361 | continue; |
350 | 362 | } |
351 | 363 | for( character in charinsert[page][line] ) { |
352 | 364 | var tool = { |
353 | 365 | type: 'link', |
354 | | - attributes: attributes, |
355 | 366 | text: '', |
356 | 367 | action: { |
357 | 368 | type: 'encapsulate', |
— | — | @@ -376,6 +387,8 @@ |
377 | 388 | retval[page] = { |
378 | 389 | label: page, |
379 | 390 | layout: 'characters', |
| 391 | + attributes: attributes, |
| 392 | + styles: styles, |
380 | 393 | characters: characters |
381 | 394 | }; |
382 | 395 | } |