-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (157 loc) · 5.01 KB
/
index.html
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" href="assets/css/global.css" />
<link rel="stylesheet" href="assets/css/github.css" />
<link rel="stylesheet" href="assets/css/main.css" />
<!-- Stylesheets -->
<link rel="stylesheet" href="assets/css/photon.min.css">
<!-- Javascript -->
<!-- <script src="assets/js/menu.js" charset="utf-8"></script> -->
</head>
<body>
<div class="window">
<!-- .toolbar-header sits at the top of your app -->
<header class="toolbar toolbar-header">
<h1 class="title">Photon</h1>
</header>
<!-- Your app's content goes inside .window-content -->
<div class="window-content">
<div class="pane-group">
<div class="pane pane-sm sidebar">
<nav class="nav-group">
<h5 class="nav-group-title">Favorites</h5>
<span class="nav-group-item">
<span class="icon icon-home"></span>
connors
</span>
<span class="nav-group-item active">
<span class="icon icon-light-up"></span>
Photon
</span>
<span class="nav-group-item">
<span class="icon icon-download"></span>
Downloads
</span>
<span class="nav-group-item">
<span class="icon icon-folder"></span>
Documents
</span>
<span class="nav-group-item">
<span class="icon icon-window"></span>
Applications
</span>
<span class="nav-group-item">
<span class="icon icon-signal"></span>
AirDrop
</span>
<span class="nav-group-item">
<span class="icon icon-monitor"></span>
Desktop
</span>
</nav>
</div>
<div class="pane">
<h1>Form Conf Checker</h1>
<div id="drop-zone">
<p>Drop your list of urls here</p>
<button id="fileUpload">Upload</button>
</div>
<table class="table-striped" id="results-table">
<thead>
<tr>
<th>URL</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
const fs = require('fs');
let url = 'https://developer.mozilla.org';
var status = 0;
fetch(url).then(
(response) => {
status = response.status;
render();
});
var table = document.querySelector('#results-table tbody');
function render(){
let snippet = `<tr>
<td>${url}</td>
<td>${status}</td>
</tr>
`;
table.innerHTML = snippet;
}
var holder = document.getElementById('drop-zone');
holder.ondragover = () => {
return false;
};
holder.ondragleave = () => {
return false;
};
holder.ondragend = () => {
return false;
};
holder.ondrop = (ev) => {
console.log("Drop");
ev.preventDefault();
var data = ev.dataTransfer.files;
for (var i = 0; i < data.length; i += 1) {
fs.readFile(data[0].path, 'utf-8', (err, result) => {
if (err) throw err;
console.log(result);
});
/*
if ((data[i].kind == 'file') &&
(data[i].type.match('^text/plain'))) {
// This item is the target node
data[i].getAsFile(function (s) {
console.log(s);
});
} else if ((data[i].kind == 'string') &&
(data[i].type.match('^text/html'))) {
// Drag data item is HTML
console.log("... Drop: HTML");
} else if ((data[i].kind == 'string') &&
(data[i].type.match('^text/uri-list'))) {
// Drag data item is URI
console.log("... Drop: URI");
} else if ((data[i].kind == 'file') &&
(data[i].type.match('^image/'))) {
// Drag data item is an image file
var f = data[i].getAsFile();
console.log("... Drop: File ");
}
*/
}
/*
e.preventDefault();
for (let f of e.dataTransfer.files) {
console.log(e.dataTransfer.getData("text"));
console.log('File(s) you dragged here: ', f.path)
fs.readFile(f.path, 'utf-8', (err, data) => {
if(err){
alert("An error ocurred reading the file :" + err.message);
return;
}
// Change how to handle the file content
console.log("The file content is : " + data);
});
}
return false;
*/
};
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>