1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
$(function () {
function isActionsModule(params)
{
return params.module == 'Actions';
}
function isPageUrlReport(params) {
var action = params.action;
return isActionsModule(params) &&
(action == 'getPageUrls' || action == 'getEntryPageUrls' || action == 'getExitPageUrls' || action == 'getPageUrlsFollowingSiteSearch');
};
function isPageTitleReport(params) {
var action = params.action;
return isActionsModule(params) && (action == 'getPageTitles' || action == 'getPageTitlesFollowingSiteSearch');
};
function getLinkForTransitionAndOverlayPopover(tr)
{
var link = tr.find('> td:first > a').attr('href');
link = $('<textarea>').html(link).val(); // remove html entities
return link;
}
DataTable_RowActions_Transitions.registerReport({
isAvailableOnReport: function (dataTableParams) {
return isPageUrlReport(dataTableParams);
},
isAvailableOnRow: function (dataTableParams, tr) {
return isPageUrlReport(dataTableParams) && tr.find('> td:first span.label').parent().is('a')
},
trigger: function (tr, e, subTableLabel) {
var link = getLinkForTransitionAndOverlayPopover(tr);
this.openPopover('url:' + link);
}
});
DataTable_RowActions_Transitions.registerReport({
isAvailableOnReport: function (dataTableParams) {
return isPageTitleReport(dataTableParams);
},
isAvailableOnRow: function (dataTableParams, tr) {
return isPageTitleReport(dataTableParams);
},
trigger: function (tr, e, subTableLabel) {
DataTable_RowAction.prototype.trigger.apply(this, [tr, e, subTableLabel]);
}
});
DataTable_RowActions_Overlay.registerReport({
isAvailableOnReport: function (dataTableParams) {
return isPageUrlReport(dataTableParams);
},
onClick: function (actionA, tr, e) {
return {
link: getLinkForTransitionAndOverlayPopover(tr),
segment: null
}
}
});
});
|