summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-09-19 21:04:57 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-09-23 15:27:17 +0000
commit188cc5c49617ba09d5cbbd6b4e27ec7bcf472d20 (patch)
treed9a6d28065b01fba819f3dbc0d8975af6069ae36
parent4487a9564b42cdedf6bb4a84134286a131583494 (diff)
downloadfreeipa-188cc5c49617ba09d5cbbd6b4e27ec7bcf472d20.tar.gz
freeipa-188cc5c49617ba09d5cbbd6b4e27ec7bcf472d20.tar.xz
freeipa-188cc5c49617ba09d5cbbd6b4e27ec7bcf472d20.zip
Fixed problem displaying special characters.
Some jQuery objects in various locations have been modified to use text() to show values obtained from the server (except messages). The text() will automatically encode special characters. Ticket #1798
-rw-r--r--install/ui/automount.js5
-rwxr-xr-xinstall/ui/certificate.js22
-rw-r--r--install/ui/details.js2
-rw-r--r--install/ui/entitle.js6
-rw-r--r--install/ui/entity.js7
-rw-r--r--install/ui/test/entity_tests.js5
-rw-r--r--install/ui/test/navigation_tests.js4
-rw-r--r--install/ui/widget.js22
8 files changed, 35 insertions, 38 deletions
diff --git a/install/ui/automount.js b/install/ui/automount.js
index 72ced6322..a4fe166e1 100644
--- a/install/ui/automount.js
+++ b/install/ui/automount.js
@@ -183,7 +183,8 @@ IPA.entity_factories.automountkey = function() {
build();
};
-IPA.automount_key_column = function(spec){
+IPA.automount_key_column = function(spec) {
+
var that = IPA.column(spec);
that.setup = function(container, record) {
@@ -193,7 +194,7 @@ IPA.automount_key_column = function(spec){
$('<a/>', {
href: '#'+key,
- html: key,
+ text: key,
click: function() {
var state = IPA.nav.get_path_state(that.entity_name);
state[that.entity_name + '-facet'] = 'default';
diff --git a/install/ui/certificate.js b/install/ui/certificate.js
index 781b59ec4..15789fc1a 100755
--- a/install/ui/certificate.js
+++ b/install/ui/certificate.js
@@ -232,25 +232,25 @@ IPA.cert.view_dialog = function(spec) {
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.common_name+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.subject.cn
+ text: that.subject.cn
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.organization+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.subject.o
+ text: that.subject.o
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.organizational_unit+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.subject.ou
+ text: that.subject.ou
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.serial_number+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.serial_number
+ text: that.serial_number
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
@@ -262,19 +262,19 @@ IPA.cert.view_dialog = function(spec) {
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.common_name+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.issuer.cn
+ text: that.issuer.cn
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.organization+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.issuer.o
+ text: that.issuer.o
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.organizational_unit+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.issuer.ou
+ text: that.issuer.ou
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
@@ -286,13 +286,13 @@ IPA.cert.view_dialog = function(spec) {
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.issued_on+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.issued_on
+ text: that.issued_on
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.expires_on+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.expires_on
+ text: that.expires_on
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
@@ -304,13 +304,13 @@ IPA.cert.view_dialog = function(spec) {
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.sha1_fingerprint+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.sha1_fingerprint
+ text: that.sha1_fingerprint
}).appendTo(tr);
tr = $('<tr/>').appendTo(table);
$('<td>'+IPA.messages.objects.cert.md5_fingerprint+':</td>').appendTo(tr);
$('<td/>', {
- 'html': that.md5_fingerprint
+ text: that.md5_fingerprint
}).appendTo(tr);
};
diff --git a/install/ui/details.js b/install/ui/details.js
index cecf97a61..e25c45875 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -205,7 +205,6 @@ IPA.details_section = function(spec) {
// methods that should be invoked by subclasses
that.section_create = that.create;
- that.section_setup = that.setup;
that.section_load = that.load;
that.section_reset = that.reset;
@@ -720,7 +719,6 @@ IPA.details_facet = function(spec) {
that.details_facet_create_content = that.create_content;
that.details_facet_load = that.load;
- that.details_facet_setup = that.setup;
return that;
};
diff --git a/install/ui/entitle.js b/install/ui/entitle.js
index 844c7ad4c..b8cff6ee2 100644
--- a/install/ui/entitle.js
+++ b/install/ui/entitle.js
@@ -509,9 +509,9 @@ IPA.entitle.certificate_column = function(spec) {
var certificate = record[that.name];
$('<a/>', {
- 'href': '#download',
- 'html': IPA.messages.objects.entitle.download,
- 'click': function() {
+ href: '#download',
+ html: IPA.messages.objects.entitle.download,
+ click: function() {
var dialog = IPA.cert.download_dialog({
title: IPA.messages.objects.entitle.download_certificate,
certificate: certificate,
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 1ae233fe4..374236011 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -196,6 +196,7 @@ IPA.facet_header = function(spec) {
while (entity) {
breadcrumb.unshift($('<a/>', {
+ 'class': 'breadcrumb-element',
text: IPA.nav.get_state(entity.name+'-pkey'),
title: entity.name,
click: function(entity) {
@@ -217,7 +218,11 @@ IPA.facet_header = function(spec) {
}
that.path.append(' &raquo; ');
- that.path.append(value);
+
+ $('<span>', {
+ 'class': 'breadcrumb-element',
+ text: value
+ }).appendTo(that.path);
}
that.title_container.empty();
diff --git a/install/ui/test/entity_tests.js b/install/ui/test/entity_tests.js
index a3561613a..12a1fcae2 100644
--- a/install/ui/test/entity_tests.js
+++ b/install/ui/test/entity_tests.js
@@ -101,10 +101,5 @@ test('Testing IPA.entity_set_search_definition().', function() {
'column.label'
);
- ok(
- column.setup,
- 'column.setup not null'
- );
-
});
diff --git a/install/ui/test/navigation_tests.js b/install/ui/test/navigation_tests.js
index ece3b56d6..90e708ccb 100644
--- a/install/ui/test/navigation_tests.js
+++ b/install/ui/test/navigation_tests.js
@@ -118,8 +118,8 @@ test("Testing IPA.navigation.update() with valid index.", function() {
content: entity_container,
tabs: [
{ name:'identity', label:'IDENTITY', children: [
- {name:'one', label:'One', setup: function (){}},
- {name:'two', label:'Two', setup: function (){}}
+ {name:'one', label:'One'},
+ {name:'two', label:'Two'}
]}
]
});
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 0c07d655d..f32dfbb18 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -445,7 +445,7 @@ IPA.text_widget = function(spec) {
var value = that.values && that.values.length ? that.values[0] : '';
if (that.read_only || !that.writable) {
- that.display_control.html(value);
+ that.display_control.text(value);
that.display_control.css('display', 'inline');
that.input.css('display', 'none');
@@ -639,8 +639,8 @@ IPA.multivalued_text_widget = function(spec) {
if (that.read_only || !that.writable) {
var label = $('<label/>', {
- 'name': that.name,
- 'html': value
+ name: that.name,
+ text: value
});
input.replaceWith(label);
@@ -1137,7 +1137,7 @@ IPA.column = function (spec) {
throw except;
}
- function setup(container, record) {
+ that.setup = function(container, record) {
container.empty();
@@ -1150,18 +1150,16 @@ IPA.column = function (spec) {
if (that.link) {
$('<a/>', {
href: '#'+value,
- html: value,
+ text: value,
click: function() {
return that.link_handler(value);
}
}).appendTo(container);
} else {
- container.append(value);
+ container.text(value);
}
- }
-
- that.setup = spec.setup || setup;
+ };
that.link_handler = function(value) {
return false;
@@ -1764,7 +1762,7 @@ IPA.combobox_widget = function(spec) {
};
that.set_value = function(value) {
- that.text.html(value);
+ that.text.text(value);
that.input.val(value);
};
@@ -1890,8 +1888,8 @@ IPA.entity_link_widget = function(spec) {
that.load = function (record){
that.widget_load(record);
if (that.values || that.values.length > 0){
- that.nonlink.html(that.values[0]);
- that.link.html(that.values[0]);
+ that.nonlink.text(that.values[0]);
+ that.link.text(that.values[0]);
that.link.css('display','none');
that.nonlink.css('display','inline');
}else{