Skip to content

Commit

Permalink
links highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Jun 11, 2015
1 parent 0ea9c0c commit 4c692e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "LightPivotTable",
"author": "ZitRo",
"version": "1.1.2",
"version": "1.2.0",
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
"main": "test/testServer.js",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions source/js/PivotView.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,13 @@ PivotView.prototype.renderRawData = function (data) {
);

var formatContent = function (value, element, format) {
if (!isFinite(value)) {
if (!isFinite(value)) { // not number, format as string
element.className += " formatLeft";
element.textContent = value || "";
element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) {
return "<a href='" + p
+ "' target='_blank' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>"
+ p + "</a>";
});
} else { // number
if (format) { // set format
element.textContent = value ? _.numeral(value).format(format) : "";
Expand Down
2 changes: 1 addition & 1 deletion test/testServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ var express = require("express"),

app.use(express.static(__dirname + "/.."));

app.listen(80);
app.listen(81);

console.info("Server ready on port 80.");

0 comments on commit 4c692e3

Please sign in to comment.