Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: EPG/status: Use alias cursor for clickable columns
  • Loading branch information
perexg committed Sep 29, 2014
1 parent 8fa6977 commit 05779c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
25 changes: 13 additions & 12 deletions src/webui/static/app/epg.js
Expand Up @@ -281,16 +281,16 @@ tvheadend.epg = function() {
]),
});

function setMetaAttr(meta, record) {
function setMetaAttr(meta, record, cursor) {
var now = new Date;
var start = record.get('start');
var extra = cursor ? 'cursor:alias;' : '';

if (now.getTime() >= start.getTime()) {
meta.attr = 'style="font-weight:bold;"';
}
if (now.getTime() >= start.getTime())
meta.attr = 'style="font-weight:bold;' + extra + '"';
}

function renderDate(value, meta, record, rowIndex, colIndex, store) {
function renderDate(value, meta, record) {
setMetaAttr(meta, record);

if (value) {
Expand All @@ -300,7 +300,7 @@ tvheadend.epg = function() {
return "";
}

function renderDuration(value, meta, record, rowIndex, colIndex, store) {
function renderDuration(value, meta, record) {
setMetaAttr(meta, record);

value = record.data.stop - record.data.start;
Expand All @@ -323,20 +323,20 @@ tvheadend.epg = function() {
}
}

function renderText(value, meta, record, rowIndex, colIndex, store) {
function renderText(value, meta, record) {
setMetaAttr(meta, record);

return value;
}

function renderTextLookup(value, meta, record, rowIndex, colIndex, store) {
setMetaAttr(meta, record);
function renderTextLookup(value, meta, record) {
setMetaAttr(meta, record, value);

if (!value) return "";
return lookup + value;
}

function renderInt(value, meta, record, rowIndex, colIndex, store) {
function renderInt(value, meta, record) {
setMetaAttr(meta, record);

return '' + value;
Expand All @@ -352,7 +352,7 @@ tvheadend.epg = function() {
dataIndex: 'progress',
colored: false,
ceiling: 100,
tvh_renderer: function(value, meta, record, rowIndex, colIndex, store) {
tvh_renderer: function(value, meta, record) {
var entry = record.data;
var start = entry.start; // milliseconds
var duration = entry.stop - start; // milliseconds
Expand Down Expand Up @@ -443,13 +443,14 @@ tvheadend.epg = function() {
id: 'genre',
header: "Content Type",
dataIndex: 'genre',
renderer: function(vals) {
renderer: function(vals, meta, record) {
var r = [];
Ext.each(vals, function(v) {
v = tvheadend.contentGroupFullLookupName(v);
if (v)
r.push(v);
});
setMetaAttr(meta, record, r.length > 0);
if (r.length < 1) return "";
return lookup + r.join(',');
},
Expand Down
6 changes: 4 additions & 2 deletions src/webui/static/app/status.js
Expand Up @@ -61,8 +61,9 @@ tvheadend.status_subs = function(panel, index)

tvheadend.comet.on('subscriptions', update);

function renderBw(value, item, record) {
function renderBw(value, meta, record) {
var txt = parseInt(value / 125);
meta.attr = 'style="cursor:alias;"';
return '<span class="x-linked">&nbsp;</span>' + txt;
}

Expand Down Expand Up @@ -262,8 +263,9 @@ tvheadend.status_streams = function(panel, index)

tvheadend.comet.on('input_status', update);

function renderBw(value, item, record) {
function renderBw(value, meta, record) {
var txt = parseInt(value / 1024);
meta.attr = 'style="cursor:alias;"';
return '<span class="x-linked">&nbsp;</span>' + txt;
}

Expand Down

0 comments on commit 05779c2

Please sign in to comment.