|
Lines 424-447
define("orion/editor/contentAssist", ['i18n!orion/editor/nls/messages', 'orion/t
Link Here
|
| 424 |
} |
424 |
} |
| 425 |
|
425 |
|
| 426 |
var contentDiv = util.createElement(document, "div"); |
426 |
var contentDiv = util.createElement(document, "div"); |
| 427 |
var nobr = util.createElement(document, "nobr"); |
427 |
contentDiv.className = "proposal"; |
| 428 |
contentDiv.appendChild(nobr); |
|
|
| 429 |
var contentNode = nobr; |
| 430 |
if( proposal.description ) { |
428 |
if( proposal.description ) { |
| 431 |
if( proposal.description.styleClass ) { |
|
|
| 432 |
contentDiv.className = proposal.description.styleClass; |
| 433 |
} |
| 434 |
|
429 |
|
| 435 |
if( proposal.description.icon ) { |
430 |
if( proposal.description.icon ) { |
| 436 |
var iconNode = util.createElement(document, "img"); |
431 |
var iconNode = util.createElement(document, "img"); |
| 437 |
iconNode.src = proposal.description.icon.src; |
432 |
iconNode.src = proposal.description.icon.src; |
| 438 |
contentNode.appendChild(iconNode); |
433 |
contentDiv.appendChild(iconNode); |
| 439 |
} |
434 |
} |
| 440 |
|
435 |
|
| 441 |
if( proposal.description.segments ) { |
436 |
if( proposal.description.segments ) { |
| 442 |
proposal.description.segments.forEach( function(segment) { |
437 |
proposal.description.segments.forEach( function(segment) { |
| 443 |
var itemNode = util.createElement(document, "span"); |
438 |
var itemNode = util.createElement(document, "span"); |
| 444 |
var styleString = ""; |
|
|
| 445 |
|
439 |
|
| 446 |
if( segment.style ) { |
440 |
if( segment.style ) { |
| 447 |
if( segment.style.bold ) { |
441 |
if( segment.style.bold ) { |
|
Lines 452-472
define("orion/editor/contentAssist", ['i18n!orion/editor/nls/messages', 'orion/t
Link Here
|
| 452 |
itemNode.style.fontStyle = "italic"; |
446 |
itemNode.style.fontStyle = "italic"; |
| 453 |
} |
447 |
} |
| 454 |
|
448 |
|
| 455 |
if(segment.style.color != null) { |
449 |
if(segment.style.color) { |
| 456 |
itemNode.style.color = segment.style.color; |
450 |
itemNode.style.color = segment.style.color; |
| 457 |
} |
451 |
} |
| 458 |
|
452 |
|
| 459 |
if(segment.style.fontName != null) { |
453 |
if(segment.style.fontFamily) { |
| 460 |
itemNode.style.fontName = segment.style.fontName; |
454 |
itemNode.style.fontFamily = segment.style.fontFamily; |
| 461 |
} |
455 |
} |
| 462 |
|
456 |
|
| 463 |
if(segment.style.backgroundColor != null) { |
457 |
if(segment.style.backgroundColor) { |
| 464 |
itemNode.style.backgroundColor = segment.style.backgroundColor; |
458 |
itemNode.style.backgroundColor = segment.style.backgroundColor; |
| 465 |
} |
459 |
} |
| 466 |
} |
460 |
} |
| 467 |
itemNode.appendChild(document.createTextNode(segment.value)); |
461 |
itemNode.appendChild(document.createTextNode(segment.value)); |
| 468 |
|
462 |
|
| 469 |
contentNode.appendChild(itemNode); |
463 |
contentDiv.appendChild(itemNode); |
| 470 |
} ); |
464 |
} ); |
| 471 |
|
465 |
|
| 472 |
} |
466 |
} |