416 format = '' |
416 format = '' |
417 frname = eid_param(self.name + '_format', entity.eid) |
417 frname = eid_param(self.name + '_format', entity.eid) |
418 hidden = u'<input type="hidden" name="edits-%s" value="%s"/>\n'\ |
418 hidden = u'<input type="hidden" name="edits-%s" value="%s"/>\n'\ |
419 '<input type="hidden" name="%s" value="text/html"/>\n' % ( |
419 '<input type="hidden" name="%s" value="text/html"/>\n' % ( |
420 frname, format, frname) |
420 frname, format, frname) |
421 return u'%s<textarea cubicweb:type="wysiwyg" onkeypress="autogrow(this)" name="%s" %s>%s</textarea>' % ( |
421 return u'%s<textarea cubicweb:type="wysiwyg" onkeyup="autogrow(this)" name="%s" %s>%s</textarea>' % ( |
422 hidden, self.rname, self.format_attrs(), dvalue) |
422 hidden, self.rname, self.format_attrs(), dvalue) |
423 if with_format and entity.e_schema.has_metadata(self.name, 'format'): |
423 if with_format and entity.e_schema.has_metadata(self.name, 'format'): |
424 fmtwdg = entity.get_widget(self.name + '_format') |
424 fmtwdg = entity.get_widget(self.name + '_format') |
425 fmtwdgstr = fmtwdg.edit_render(entity, tabindex=self.attrs['tabindex']) |
425 fmtwdgstr = fmtwdg.edit_render(entity, tabindex=self.attrs['tabindex']) |
426 self.attrs['tabindex'] = entity.req.next_tabindex() |
426 self.attrs['tabindex'] = entity.req.next_tabindex() |
427 else: |
427 else: |
428 fmtwdgstr = '' |
428 fmtwdgstr = '' |
429 return u'%s<br/><textarea onkeypress="autogrow(this)" name="%s" %s>%s</textarea>' % ( |
429 return u'%s<br/><textarea onkeyup="autogrow(this)" name="%s" %s>%s</textarea>' % ( |
430 fmtwdgstr, self.rname, self.format_attrs(), dvalue) |
430 fmtwdgstr, self.rname, self.format_attrs(), dvalue) |
431 |
431 |
432 |
432 |
433 class CheckBoxWidget(Widget): |
433 class CheckBoxWidget(Widget): |
434 html_attributes = Widget.html_attributes | set(('checked', )) |
434 html_attributes = Widget.html_attributes | set(('checked', )) |