James Somers
James Somers
James Somers
James Somers
James Somers
', {html: contents, style: Doc.calculateParagraphStyleString(null)})[0].outerHTML
}
calculateTextStyles: function(character) {
var mappings = { "ts_it": "font-style: italic",
"ts_bd": "font-weight: bold",
"ts_un": "text-decoration: underline",
"ts_sc": "small_caps", // maybe?
"ts_st": "text-decoration: line-through",
"ts_va": "vertical-align: {{value}}", // "sup" or "sub"
"ts_fs": "font-size: {{value}}",
"ts_ff": "font-family: {{value}}",
"ts_bgc": "background-color: {{value}}",
"ts_fgc": "foreground-color: {{value}}"
}
var calculatedStyles = []
$.each(mappings, function(propertyName, impliedStyle) {
if (character[propertyName] && !character[propertyName + "_i"]) {
calculatedStyles.push(impliedStyle.replace('{{value}}', character[propertyName]))
}
})
return calculatedStyles
},
spanRenderer: function(substring, styles) {
return $('', {text: substring, style: styles.join(';')})[0].outerHTML
}