1
0
Fork 0
forked from 0x2620/oxjs

Ox.parseHTML -> Ox.sanitizeHTML, Ox.encodeHTML -> Ox.encodeHTMLEntities, Ox.decodeHTML -> Ox.decodeHTMLEntities

This commit is contained in:
rolux 2012-05-27 12:40:02 +02:00
commit c41afd2f5d
9 changed files with 28 additions and 26 deletions

View file

@ -155,7 +155,7 @@ Ox.Editable = function(options, self) {
}
function formatInputValue() {
return Ox.decodeHTML(
return Ox.decodeHTMLEntities(
self.options.type == 'input'
? self.options.value
: self.options.value.replace(/<br\/?><br\/?>/g, '\n\n')
@ -163,7 +163,7 @@ Ox.Editable = function(options, self) {
}
function formatTestValue() {
var value = Ox.encodeHTML(self.$input.options('value'));
var value = Ox.encodeHTMLEntities(self.$input.options('value'));
return !value ? '&nbsp;'
: self.options.type == 'input'
? value.replace(/ /g, '&nbsp;')
@ -181,7 +181,7 @@ Ox.Editable = function(options, self) {
value = self.options.format(self.options.value)
}
if (self.options.highlight) {
value = Ox.highlightHTML(value, self.options.highlight, 'OxHighlight');
value = Ox.highlightHTML(value, self.options.highlight, 'OxHighlight', true);
}
return value;
}
@ -191,8 +191,8 @@ Ox.Editable = function(options, self) {
self.$input.value().replace(/\n\n+/g, '\0')
).replace(/\0/g, '\n\n').trim();
return (self.options.type == 'input'
? Ox.encodeHTML(value)
: Ox.parseHTML(value)
? Ox.encodeHTMLEntities(value)
: Ox.sanitizeHTML(value)
);
}