|
|
@ -45,32 +45,28 @@ jQuery.fn.dataTable.render.anchor = function (
|
|
|
|
innerText = data;
|
|
|
|
innerText = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (attributes typeof 'function') {
|
|
|
|
var attributes = attributes typeof 'function' ? attributes(data, row, meta) : attributes;
|
|
|
|
var tagAttributes = attributes(data, row, meta);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
var tagAttributes = attributes;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!tagAttributes.href) {
|
|
|
|
if (!attributes.href) {
|
|
|
|
switch (type) {
|
|
|
|
switch (type) {
|
|
|
|
case 'mail':
|
|
|
|
case 'mail':
|
|
|
|
tagAttributes.href = 'mailto:' + data;
|
|
|
|
attributes.href = 'mailto:' + data;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'phone':
|
|
|
|
case 'phone':
|
|
|
|
tagAttributes.href = 'tel:' + data.replace(/[^+\d]+/g, '');
|
|
|
|
attributes.href = 'tel:' + data.replace(/[^+\d]+/g, '');
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'link':
|
|
|
|
case 'link':
|
|
|
|
case default:
|
|
|
|
case default:
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
tagAttributes.href = new URL(data);
|
|
|
|
attributes.href = new URL(data);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
tagAttributes.href = data;
|
|
|
|
attributes.href = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var anchorEl = jQuery('</a>');
|
|
|
|
var anchorEl = jQuery('</a>');
|
|
|
|
anchorEl.attr(tagAttributes).text(innerText === null ? data : innerText);
|
|
|
|
anchorEl.attr(attributes).text(innerText);
|
|
|
|
|
|
|
|
|
|
|
|
return anchorEl[0].outerText;
|
|
|
|
return anchorEl[0].outerText;
|
|
|
|
};
|
|
|
|
};
|
|
|
|