From 5ba389bd863cf144bdbdfc0e543a7c73470f0610 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 5 Dec 2014 20:11:40 +0100 Subject: [PATCH] WEBUI DVR: Add more informative questions for the delete operation --- src/webui/static/app/dvr.js | 4 ++++ src/webui/static/app/idnode.js | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js index d95d3893..5876b155 100644 --- a/src/webui/static/app/dvr.js +++ b/src/webui/static/app/dvr.js @@ -267,6 +267,8 @@ tvheadend.dvr_finished = function(panel, index) { iconCls: 'finishedRec', tabIndex: index, del: true, + delquestion: 'Do you really want to delete the selected recordings?

' + + 'The associated file will be removed from the storage.', list: 'disp_title,episode,start_real,stop_real,' + 'duration,filesize,channelname,creator,' + 'sched_status,url,comment', @@ -345,6 +347,8 @@ tvheadend.dvr_failed = function(panel, index) { iconCls: 'exclamation', tabIndex: index, del: true, + delquestion: 'Do you really want to delete the selected recordings?

' + + 'The associated file will be removed from the storage.', list: 'disp_title,episode,start_real,stop_real,' + 'duration,filesize,channelname,creator,' + 'status,sched_status,url,comment', diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 2b21f610..c4d76672 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -1162,7 +1162,7 @@ tvheadend.idnode_grid = function(panel, conf) var uuids = []; for (var i = 0; i < r.length; i++) uuids.push(r[i].id); - tvheadend.AjaxConfirm({ + c = { url: 'api/idnode/delete', params: { uuid: Ext.encode(uuids) @@ -1172,7 +1172,10 @@ tvheadend.idnode_grid = function(panel, conf) if (!auto.getValue()) store.reload(); } - }); + }; + if (conf.delquestion) + c['question'] = conf.delquestion; + tvheadend.AjaxConfirm(c); } } }); @@ -1644,7 +1647,7 @@ tvheadend.idnode_form_grid = function(panel, conf) disabled: true, handler: function() { if (current) { - tvheadend.AjaxConfirm({ + var c = { url: 'api/idnode/delete', params: { uuid: current.uuid @@ -1653,7 +1656,10 @@ tvheadend.idnode_form_grid = function(panel, conf) roweditor_destroy(); store.reload(); } - }); + }; + if (conf.delquestion) + c['delquestion'] = conf.delquestion; + tvheadend.AjaxConfirm(c); } } });