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

This commit is contained in:
rolux 2012-05-27 12:51:08 +02:00
parent fc713cabb6
commit 5aac6ebe22
2 changed files with 10 additions and 6 deletions

View file

@ -60,7 +60,7 @@ pandora.ui.importAnnotations = function(data) {
function addAnnotation() { function addAnnotation() {
if(srt.length>0) { if(srt.length>0) {
var data = srt.shift(); var data = srt.shift();
data.text = Ox.parseHTML(data.text) data.text = Ox.sanitizeHTML(data.text)
.replace(/<br[ /]*?>\n/g, '\n') .replace(/<br[ /]*?>\n/g, '\n')
.replace(/\n\n/g, '<br>\n') .replace(/\n\n/g, '<br>\n')
.replace(/\n/g, '<br>\n'); .replace(/\n/g, '<br>\n');

View file

@ -172,10 +172,14 @@ pandora.ui.listInfo = function() {
$title = Ox.Editable({ $title = Ox.Editable({
editable: editable, editable: editable,
format: function(value) { format: function(value) {
return Ox.encodeHTML(Ox.decodeHTML( // FIXME: document what we're trying to do here!
item.status == 'featured' || editable return Ox.encodeHTMLEntities(
? value Ox.decodeHTMLEntities(
: item.user + ': ' + value)) item.status == 'featured' || editable
? value
: item.user + ': ' + value
)
)
}, },
tooltip: editable ? 'Doubleclick to edit title' : '', tooltip: editable ? 'Doubleclick to edit title' : '',
value: item.name, value: item.name,
@ -189,7 +193,7 @@ pandora.ui.listInfo = function() {
}); });
}, },
submit: function(data) { submit: function(data) {
data.value = Ox.decodeHTML(data.value); data.value = Ox.decodeHTMLEntities(data.value);
if (data.value != item.name) { if (data.value != item.name) {
pandora.api.editList({ pandora.api.editList({
id: list, id: list,