Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -258,27 +258,32 @@ |
259 | 259 | } |
260 | 260 | } |
261 | 261 | break; |
262 | | - case 'specialchar': |
| 262 | + case 'characters': |
263 | 263 | // Appends special character adders |
264 | 264 | for ( character in section.pages[page].characters ) { |
265 | 265 | switch( section.pages[page].characters[character].type ) { |
266 | 266 | case 'break': |
267 | | - pageDiv.append( $( '<br />' ) ); |
| 267 | + /* |
| 268 | + pageDiv.append( |
| 269 | + $( '<div />' ) |
| 270 | + .css( 'clear', 'both' ) |
| 271 | + ); |
| 272 | + */ |
268 | 273 | break; |
269 | 274 | case 'link': |
270 | 275 | var context = { |
271 | 276 | 'tool' : section.pages[page].characters[character], |
272 | 277 | 'textbox': textbox |
273 | 278 | }; |
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; } ) |
281 | 287 | ); |
282 | | - pageDiv.append( ' ' ); |
283 | 288 | break; |
284 | 289 | } |
285 | 290 | } |
— | — | @@ -335,17 +340,17 @@ |
336 | 341 | parseCharinsert: function( charinsert ) { |
337 | 342 | var retval = {}; |
338 | 343 | for( page in charinsert ) { |
339 | | - var characters = [], attrs = {}; |
| 344 | + var characters = [], attributes = {}; |
340 | 345 | var i = 0; |
341 | 346 | for( line in charinsert[page] ) { |
342 | 347 | if( !( charinsert[page][line] instanceof Array ) ) { |
343 | | - attrs = charinsert[page][line]; |
| 348 | + attributes = charinsert[page][line]; |
344 | 349 | continue; |
345 | 350 | } |
346 | | - for( chr in charinsert[page][line] ) { |
| 351 | + for( character in charinsert[page][line] ) { |
347 | 352 | var tool = { |
348 | 353 | type: 'link', |
349 | | - attrs: attrs, |
| 354 | + attributes: attributes, |
350 | 355 | text: '', |
351 | 356 | action: { |
352 | 357 | type: 'encapsulate', |
— | — | @@ -355,13 +360,13 @@ |
356 | 361 | } |
357 | 362 | } |
358 | 363 | }; |
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]; |
363 | 368 | } 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]; |
366 | 371 | } |
367 | 372 | tool.text = tool.action.options.pre + tool.action.options.post; |
368 | 373 | characters[i++] = tool; |
— | — | @@ -370,7 +375,7 @@ |
371 | 376 | } |
372 | 377 | retval[page] = { |
373 | 378 | label: page, |
374 | | - layout: 'specialchar', |
| 379 | + layout: 'characters', |
375 | 380 | characters: characters |
376 | 381 | }; |
377 | 382 | } |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.css |
— | — | @@ -156,6 +156,26 @@ |
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 { |
| 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 | +} |
160 | 180 | div#edittoolbar div.tabs > div.tab { |
161 | 181 | float: left; |
162 | 182 | line-height: 26px; |