-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilelist.aspx
More file actions
178 lines (122 loc) · 4.24 KB
/
Copy pathfilelist.aspx
File metadata and controls
178 lines (122 loc) · 4.24 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<%@ Page Language="C#"
EnableEventValidation="false"
EnableViewState="false" %>
<%@ Import Namespace="edu.neu.ccis.rasala" %>
<%@ Import Namespace="System.Collections.Generic" %>
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
string rootpath = FileTools.GetRoot(this);
bool onlyPublic = true;
List<string> DirectoryList =
SourceTools.MakeDirectoryList(rootpath, onlyPublic);
List<string> tildeRootList =
FileTools.GetTildePaths(rootpath, DirectoryList);
RootList.DataSource = tildeRootList;
RootList.DataBind();
}
</script>
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<meta name="viewport" content="initial-scale=1, minimum-scale=1">
<title>File List</title>
<link rel="stylesheet" type="text/css" href="source/source.css" />
<link rel="stylesheet" type="text/css" href="source/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="fileliststyle.css" />
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="javascript/print.js"></script>
<script type="text/javascript">
var content$;
var url = "";
// This function is solely for testing the acquisition of input
// from the dropdown, text fields, and radio buttons. It isn't
// production code.
function testinput() {
var root = $(".dropdown>option:selected").val();
var start = $(".startdate").val();
var end = $(".enddate").val();
var sort = $("input[name='sortoptions']:checked").val();
var s = "<p class='test'>" + "root: " + root + "</p>\n";
s += "<p class='test'>" + "start: " + start + "</p>\n";
s += "<p class='test'>" + "end: " + end + "</p>\n";
s += "<p class='test'>" + "sort: " + sort + "</p>\n";
content$.html(s);
}
// The function to fetch files based on the parameters
// root, start, end, sort
function fetchfiles() {
var root = $(".dropdown>option:selected").val();
var start = $(".startdate").val();
var end = $(".enddate").val();
var sort = $("input[name='sortoptions']:checked").val();
url = "filelistdata.aspx?root=" + root + "&start=" + start
+ "&end=" + end + "&sort=" + sort + " .results";
content$.load(url);
}
function errorhandler() {
var s = "<p> Error with <code>" + url + "</code></p>";
content$.html(s);
}
function initialize() {
$.ajaxSetup({
timeout: 240000,
error: errorhandler
});
content$ = $("#content");
$(".button").click(fetchfiles);
}
$(initialize);
</script>
</head>
<body>
<p class="large">File List Server</p>
<p class="large"><a href="Default.aspx" target="_blank">Home</a></p>
<p class="normal">Root Directory for the File Selection</p>
<form id="form1" runat="server" enableviewstate="false">
<p>
<asp:DropDownList ID="RootList"
Runat="server"
CssClass="dropdown" >
</asp:DropDownList>
</p>
</form>
<p class="monospace">
Date Time Format: yyyy-mm-dd_hh-mm-ss_xxx or a substring
with this structure.
<br />
<br />
The following special dates are also recognized:
<br />
'now', 'today', and 'today-N' where N is a positive integer.
<br />
<br />
If no date is provided, defaults to the first moment of the current year.
</p>
<p class="normal">
Start Date Time
</p>
<p>
<input type="text" class="textinput startdate" value="today" />
</p>
<p class="normal">
End Date Time
</p>
<p>
<input type="text" class="textinput enddate" value="now" />
</p>
<p class="normal">Sort Options</p>
<ul class="plain">
<li><input type="radio" name="sortoptions" value="alpha" checked="checked" /> Alphabetic</li>
<li><input type="radio" name="sortoptions" value="date" /> By Date</li>
<li><input type="radio" name="sortoptions" value="size" /> By Size</li>
</ul>
<p>
<input type="button" class="button" value="Fetch Files" />
</p>
<hr />
<div id="content"></div>
</body>
</html>