Skip to content

Commit

Permalink
Fixed some display and data entry issues with HTML data.
Browse files Browse the repository at this point in the history
  • Loading branch information
ipaterson committed Feb 24, 2011
1 parent de1b5cc commit 2191101
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/botoweb/ui/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,14 @@ $forms.Field = function (prop, opt) {
var val = self.prop.meta.def;

if ('val' in self.opt) {
val = self.opt.val;
val = self.opt.val.toString();
}
else if ('def' in self.opt) {
val = self.opt.def;
val = self.opt.def.toString();
}

if (!$(this).val().length)
$(this).val(val);
$(this).val(val.replace(/</g, '&lt;'));
});
}

Expand Down Expand Up @@ -605,11 +605,12 @@ $forms.Field = function (prop, opt) {
* interfaces.
*/
this.build_field = function (value) {

if (value)
value = $util.html_unescape(value.val);
value = value.val; //$util.html_unescape(value.val);
else
value = '';

if (this.opt.template) {
return this.opt.template.clone().addClass('editing_template');
}
Expand Down
7 changes: 6 additions & 1 deletion src/botoweb/ui/markup/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,12 @@
}

else if (block.obj) {
$markup.set_html(node, prop.toString() || '');
var str = prop.toString();

if (node.attr($markup.prop.format) != 'html')
str = botoweb.util.html_format(str);

$markup.set_html(node, str || '');
}

if (editable && prop.meta.write) {
Expand Down

0 comments on commit 2191101

Please sign in to comment.