new_element_index = {}\r
new_element_index[pettanr_current_panel_id] = 0\r
\r
- escapeHTML = (t) ->\r
- $("<div/>").text(t).html()\r
-\r
set_tree_value = (keys, last_attr, value) ->\r
key = keys.shift()\r
if keys.length <= 0\r
$(@).focusout ->\r
switch $(@).attr('column')\r
when 'content'\r
- trace = element_tag_id($(@))\r
- speech_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'speech' + $(@).attr('element_part_id')\r
- v = escapeHTML($(@).val())\r
- $(speech_trace).html(v)\r
+ trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'speech' + $(@).attr('element_part_id')\r
+ wf_sel = $(trace + 'writing_format_id')\r
+ wf_id = parseInt(wf_sel.val())\r
+ v = writing_format_functions[writing_formats[wf_id]]($(@).val())\r
+ $(trace).html(v)\r
$('textarea').map ->\r
if $(@).attr('element_type') and $(@).attr('element_type') == 'speech_balloon'\r
switch $(@).attr('column')\r
when 'content'\r
$(@).bind('textchange', (event, previousText) ->\r
- trace = element_tag_id($(@))\r
+ trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'speech' + $(@).attr('element_part_id')\r
wf_sel = $(trace + 'writing_format_id')\r
wf_id = parseInt(wf_sel.val())\r
- speech_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'speech' + $(@).attr('element_part_id')\r
- fn = writing_formats[wf_id].toString() + '_render()'\r
- confirm(fn )\r
-# f = new Function("return " + fn)\r
-# f()\r
- v = escapeHTML($(@).val())\r
- $(speech_trace).html(v)\r
+ v = writing_format_functions[writing_formats[wf_id]]($(@).val())\r
+ $(trace).html(v)\r
)\r
\r
\r