function drawCodeExample() {
var canvas = $('<div />').addClass('widget-container');
var codeContainer = $('<div />').addClass('widget code-container ui-corner-all');
var captionContainer = $('<div />').addClass('caption-container');
$('<span />', {
text: 'Code example'
}).addClass('caption').appendTo(captionContainer);
captionContainer.appendTo(codeContainer);
var codeContent = $('<pre />', {
'id': 'w0'
}).addClass("code").appendTo(codeContainer);
var lines = ['select * from person', 'select * from person where _id_ = ...']
for (var i = 0; i < lines.length; i++) {
$('<span />', {
'text': lines[i]
}).addClass("codeline").appendTo(codeContent);
}
codeContainer.appendTo(canvas);
canvas.appendTo($('#embeddedComponentContent'));
} |