allow language attributes in text and annotations

This commit is contained in:
j 2013-12-26 16:41:40 +00:00
parent 6e49032602
commit ad7c36881c
3 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@ import ox
def cleanup_value(value, layer_type):
#FIXME: what about other types? location etc
if layer_type == 'text':
value = ox.sanitize_html(value)
value = ox.sanitize_html(value, global_attributes=['lang'])
else:
value = ox.escape_html(value)
return value

View file

@ -128,9 +128,9 @@ class Text(models.Model):
name = data['name'] + ' [%d]' % num
self.name = name
elif key == 'description':
self.description = ox.sanitize_html(data['description'])
self.description = ox.sanitize_html(data['description'], global_attributes=['lang'])
elif key == 'text':
self.text = ox.sanitize_html(data['text'], global_attributes=['data-name'])
self.text = ox.sanitize_html(data['text'], global_attributes=['data-name', 'lang'])
elif key == 'rightslevel':
self.rightslevel = int(data['rightslevel'])

View file

@ -312,7 +312,7 @@ pandora.ui.textHTML = function(text) {
}
);
},
globalAttributes: ['data-name'],
globalAttributes: ['data-name', 'lang'],
placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
tooltip: text.editable ? pandora.getEditTooltip('text') : '',
type: 'textarea',