/
FrameList.xxm
107 lines (102 loc) · 2.95 KB
/
FrameList.xxm
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[[@Windows,txDefs,DataLank,txSession,txFilter,txFilterSql,txCache,]][[!var
qr:TQueryResult;
rpFilter:TtxRealmPermission;
filter:string;
fs:UTF8String;
f:TtxFilter;
fq:TtxSqlQueryFragments;
ic:TItemCache;
]][[
Context.Include('dFrameHead.xxmi');
filter:=Context['filter'].Value;
<<script><!--
function frametree_expandto(t,p)
{
if(t=="i")
{
$(".highlight").removeClass("highlight");
var x=new String(p).split(",");
var y=$("#listitem_"+x[x.length-1]);
if(y.length==1)
{
window.scrollTo(0,y[0].offsetTop-((window.innerHeight||document.body.clientHeight)/3));
y.addClass("highlight");
}
}
}
function frametree_update(t,p)
{
if(t=="i") $("#listitem_"+p).load("iFrameList.xxm",{id:p,xxx:"[[=Session.SessionCrypt]]"});
}
function frametree_updatedelete(t,p)
{
if(t=="i") $("#listitemfull_"+p).remove();
}
function listitem_select(e,id)
{
if(window.parent.frames["MainFrame"].window.catchTreeClick)
window.parent.frames["MainFrame"].window.catchTreeClick(id,$("#listlink_"+id)[0]);
else
window.parent.frames["MainFrame"].location.replace("Item.xxm?x=i"+id);
return (e||window.event||this).shiftKey;
}
function listitem_highlight(e)
{
var n=e.target;
while(n&&!n.id.startsWith("listitemfull_"))n=n.parentElement;
if(n){
if(highlightedItem)highlightedItem.className="";
n.className="highlight";
highlightedItem=n;
}
}
var highlightedItem=null;
//--></script>
<span style="white-space:nowrap;" onclick="listitem_highlight(event);">>
if Context['all'].AsInteger=1 then rpFilter:=rpAny else rpFilter:=rpView;
f:=TtxFilter.Create;
fq:=TtxSqlQueryFragments.Create(itObj);
try
f.FilterExpression:=UTF8Encode(filter);
if f.ParseError<>'' then
begin
<<p style="color:red;">>=f.ParseError<</p>>
end;
fq.AddFilter(f);
fq.Where:='Obj.rlm_id'+Session.Realms[rpFilter].SQL+' AND ('+fq.Where+')';
fs:=fq.SQL;
finally
f.Free;
fq.Free;
end;
<<p id="fliTitle" class="highlight1" style="position:absolute;margin:0em;font-weight:bold;"></p>
<p>
<span class="litref">>=filter<</span>
<a class="linkbutton" href="Filter.xxm?filter=[[=URLEncode(filter)]]" target="MainFrame">filter</a>
<a class="linkbutton" href="FilterBuild.xxm?filter=[[=URLEncode(filter)]]" target="MainFrame">build</a>
</p>>
qr:=TQueryResult.Create(Session.DbCon,fs,[]);
try
if qr.EOF then
begin
<<p><i>No items found.</i></p>>
end
else
begin
ic:=TItemCache.Create;
try
while qr.Read and Context.Connected do Context.Include('FrameListItem.xxmi',[],[qr,ic]);
finally
ic.Free;
end;
end;
finally
qr.Free;
end;
<</span>
<script><!--
$(".fli")
.mouseenter(function(){$("."+this.className.split(" ")[1]).addClass("highlight1");$("#fliTitle").text(this.title);})
.mouseleave(function(){$("."+this.className.split(" ")[1]).removeClass("highlight1");$("#fliTitle").text("");});
//--></script>>
Context.Include('dFrameFoot.xxmi');