'=': '='
};
var htmlEscaper = /[&<>"'\/`=]/g;
+ var symbolDescriptions = {};
EscapeHTML = function(string) {
return ('' + string).replace(htmlEscaper, function(match) {
sym.name = key;
}
sym.name = EscapeHTML(key);
- sym.description = EscapeHTML(sym.description);
+ if (sym.description) {
+ sym.description = EscapeHTML(sym.description);
+ }
if (sym.options) {
escape_HTML_array(sym.options);
preprocess_item(item);
Object.keys(item.symbols).map(function(key) {
var sym = item.symbols[key];
-
- var str = '<strong>' + sym.name + '</strong>' + "(" + sym.score + ")";
+
+ if (sym.description) {
+ var str = '<strong><abbr data-sym-key="' + key + '">' + sym.name + '</abbr></strong>' + "(" + sym.score + ")";
+
+ // Store description for tooltip
+ symbolDescriptions[key] = sym.description;
+ } else {
+ var str = '<strong>' + sym.name + '</strong>' + "(" + sym.score + ")";
+ }
if (sym.options) {
str += '[' + sym.options.join(",") + "]";
"sorting": {
"enabled": true
},
- components: {
- filtering: FooTable.actionFilter
+ "components": {
+ "filtering": FooTable.actionFilter
+ },
+ "on": {
+ "ready.ft.table": function () {
+ // Update symbol description tooltips
+ $.each(symbolDescriptions, function (key, description) {
+ $('abbr[data-sym-key=' + key + ']').tooltip({
+ "placement": "bottom",
+ "html": true,
+ "title": description
+ });
+ });
+ }
}
});
} else {