forked from FaisalUmair/udemy-downloader-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
420 lines (403 loc) · 19.2 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Udeler | Udemy Course Downloader</title>
<link rel="stylesheet" href="assets/css/semantic.min.css" />
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<body>
<div class="ui basic subtitle modal">
<div class="ui icon header">
<i class="closed captioning icon"></i>
Select Subtitle
</div>
<div class="content">
<div class="ui fluid selection dropdown">
<input type="hidden" name="subtitle" />
<i class="dropdown icon"></i>
<div class="default text">Subtitle Language</div>
</div>
</div>
</div>
<div class="ui basic update-available modal">
<div class="ui icon header">
<i class="gift icon"></i>
New Update Available
</div>
<div class="content">
<p>
<center>
A new version of Udeler is available. You can download the latest
version from github releases page
</center>
</p>
</div>
<div class="actions" style="text-align: center;">
<div class="ui red cancel inverted button">
<i class="remove icon"></i>
Cancel
</div>
<div class="ui green ok inverted download-update button">
<i class="checkmark icon"></i>
Download
</div>
</div>
</div>
<script>
const $ = (jQuery = require("jquery"));
</script>
<script src="assets/js/semantic.min.js"></script>
<script type="text/javascript">
const settings = require("electron-settings");
const appVersion = require(__dirname + "/package.json").version;
function translate(text) {
if (
!settings.get("general.language") ||
settings.get("general.language") == "English"
) {
return text;
} else {
try {
var meta = require("./locale/meta.json");
var locale = require(`./locale/${
meta[settings.get("general.language")]
}`);
return locale[text] || text;
} catch (e) {
return text;
}
}
}
var template = `
<div class="ui center aligned login grid">
<div class="ui login dimmer">
<div class="ui big text loader">${translate("Logging in")}</div>
</div>
<div class="ui authenticator dimmer">
<div class="ui big text loader">
${translate("Awaiting Login Request")}
</div>
</div>
<div class="row">
<div class="ten wide column">
<h2 class="ui icon grey login header">
<i class="circular green user icon"></i>
${translate("Udemy Login")}
</h2>
</div>
</div>
<div class="row">
<div class="ten wide column">
<form class="ui form">
<div class="field">
<div class="ui fluid label checkbox">
<input type="checkbox" name="business" id="business">
<label for="business">${translate(
"Udemy Business"
)} ?</label>
</div>
</div>
<div class="field">
<input type="text" id="subdomain" name="subdomain" placeholder="${translate(
"Udemy Business Name"
)}" style="display: none">
</div>
</form>
<div class="ui horizontal divider">
Choose Login Method
</div>
<button class="ui fluid green button" type="button" onclick="loginWithUdemy()">${translate(
"Login Using Credentials"
)}</button>
<div class="ui horizontal divider">
Or
</div>
<div class="ui fluid icon buttons">
<button class="ui teal login disabled authenticator button"><i class="user secret icon"></i> Authenticator</button>
<div class="or"></div>
<button class="ui blue button" onclick="loginWithAccessToken()"><i class="key icon"></i> Access Token</button>
</div>
</div>
</div>
</div>
<div class="ui dashboard">
<div class="ui logout dimmer">
<div class="ui big text loader">${translate("Logging Out")}</div>
</div>
<div class="ui courses dimmer">
<div class="ui big text loader">${translate(
"Loading Courses"
)}</div>
</div>
<div class="ui course dimmer">
<div class="ui big text loader">${translate("Getting Info")}</div>
</div>
<div class="ui about dimmer">
<div class="ui big text loader">${translate(
"Checking for Updates"
)}</div>
</div>
<div class="ui visible fixed vertical inverted sidebar labeled icon menu ${
settings.get("general.language") == "Arabic" ? "right" : "left"
}">
<a class="active red courses-sidebar item">
<i class="file video icon"></i>
${translate("Courses")}
</a>
<a class="downloads-sidebar item">
<i class="download icon"></i>
${translate("Downloads")}
</a>
<a class="settings-sidebar item">
<i class="wrench icon"></i>
${translate("Settings")}
</a>
<a class="about-sidebar item">
<i class="info icon"></i>
${translate("About")}
</a>
<a class="logout-sidebar item">
<i class="power off icon"></i>
${translate("Logout")}
</a>
</div>
<div class="content">
<div class="ui courses section">
<form class="ui search form">
<div class="ui fluid search">
<div class="ui fluid icon input">
<input class="prompt" type="text" placeholder="${translate(
"Search Courses"
)}">
<i class="search icon"></i>
</div>
</div>
</form>
<div class="ui divided unstackable courses items">
</div>
</div>
<div class="ui downloads section">
<h5 class="ui top attached header">
<i class="ui download icon"></i> ${translate(
"Downloads"
)}
</h5>
<div class="ui divided unstackable courses items attached segment">
</div>
</div>
<div class="ui settings section">
<form class="ui form">
<h5 class="ui top attached header">
<i class="ui download icon"></i> ${translate(
"Download Settings"
)}
</h5>
<div class="ui attached segment">
<div class="field">
<label>${translate(
"Download Path"
)}</label>
<div class="ui action input">
<input type="text" readonly name="downloadpath">
<label class="ui icon button btn-file" onclick="selectDownloadPath()">
<i class="folder icon"></i>
</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="enabledownloadstartend">
<label>${translate(
"Enable Download Start/End"
)}</label>
</div>
</div>
<div class="two unstackable fields">
<div class="field">
<label>${translate(
"Download Start"
)}</label>
<input placeholder="${translate(
"Start Download at"
)}" type="number" min="1" name="downloadstart">
</div>
<div class="field">
<label>${translate("Download End")}</label>
<input placeholder="${translate(
"End Download at"
)}" type="number" min="1" name="downloadend">
</div>
</div>
<div class="ui divider"></div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="skipattachments">
<label>${translate(
"Skip Attachments"
)}</label>
</div>
</div>
<div class="field">
<label>${translate(
"Video Quality"
)}</label>
<div class="ui fluid search selection dropdown">
<input type="hidden" name="videoquality">
<i class="dropdown icon"></i>
<div class="default text"></div>
<div class="menu">
<div class="item" data-value="Auto">${translate(
"Auto"
)}</div>
<div class="item" data-value="Lowest">${translate(
"Lowest"
)}</div>
<div class="item" data-value="360p">360p</div>
<div class="item" data-value="480p">480p</div>
<div class="item" data-value="720p">720p</div>
<div class="item" data-value="1080p">1080p</div>
<div class="item" data-value="Highest">${translate(
"Highest"
)}</div>
</div>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="skipsubtitles">
<label>${translate(
"Skip Subtitles"
)}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="autoretry">
<label>${translate(
"Auto Retry on Error (Experimental)"
)}</label>
</div>
</div>
</div>
<h5 class="ui top attached header">
<i class="ui setting icon"></i> ${translate(
"Application Settings"
)}
</h5>
<div class="ui attached segment">
<div class="field">
<label>${translate(
"Language (Requires App Restart)"
)}</label>
<div class="ui fluid search selection language dropdown">
<input type="hidden" name="language">
<i class="dropdown icon"></i>
<div class="default text"></div>
<div class="menu">
<div class="item" data-value="English">English</div>
</div>
</div>
</div>
</div>
<div class="ui horizontal divider"></div>
<button class="ui fluid green button" type="submit">${translate(
"Save"
)}</button>
</form>
</div>
<div class="ui about section">
<div class="ui segment">
<h4 class="ui center aligned icon header">
<i class="grey file code outline icon"></i>
Udeler v${appVersion}
</h4>
<button class="ui tiny fluid basic check-updates button">${translate(
"Check for updates"
)}</button>
<h3 class="ui header">${translate("Links")}</h3>
<div class="ui relaxed divided list">
<div class="item">
<i class="large github middle aligned icon"></i>
<div class="content">
<a class="header" href="https://github.com/FaisalUmair/udemy-downloader-gui">FaisalUmair/udemy-downloader-gui</a>
<div class="description">${translate(
"Repository"
)}</div>
</div>
</div>
<div class="item">
<i class="large github middle aligned icon"></i>
<div class="content">
<a class="header" href="https://github.com/FaisalUmair">FaisalUmair</a>
<div class="description">${translate(
"Developer"
)}</div>
</div>
</div>
<div class="item">
<i class="large world middle aligned icon"></i>
<div class="content">
<a class="header" href="http://thewebartisans.net/">thewebartisans.net</a>
<div class="description">${translate(
"Website"
)}</div>
</div>
</div>
</div>
<h3 class="ui header">${translate(
"Development"
)}</h3>
<div class="ui relaxed divided list">
<div class="item">
<i class="large github middle aligned icon"></i>
<div class="content">
<a class="header" href="https://github.com/FaisalUmair/udemy-downloader-gui/issues">udemy-downloader-gui/issues</a>
<div class="description">${translate(
"Report Bug"
)}</div>
</div>
</div>
<div class="item">
<i class="large github middle aligned icon"></i>
<div class="content">
<a class="header" href="https://github.com/FaisalUmair/udemy-downloader-gui/pulls">udemy-downloader-gui/pulls</a>
<div class="description">${translate(
"Contribute"
)}</div>
</div>
</div>
</div>
<h3 class="ui header">${translate("Donate")}</h3>
<p>
${translate(
"Udeler is free and without any ads. If you appreciate that, please consider donating to the Developer."
)}
</p>
<br>
<a href="https://www.udeler.com/donate" class="ui centered donate grid">
<img src="assets/images/donate.png" alt="Donate"/>
</a>
</div>
</div>
</div>
</div>
`;
$("body").prepend(template);
if (settings.get("general.language") == "Arabic") {
$(".ui.dashboard .content")
.css("margin-left", "10px")
.css("width", "80%");
}
var $languageDropdown = $(".language.dropdown .menu");
$.getJSON("locale/meta.json", function(data) {
$.each(data, function(key) {
$languageDropdown.append(
`<div class="item" data-value=${key}>${key}</div>`
);
});
});
</script>
<script src="assets/js/app.js"></script>
</body>
</html>