-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
578 lines (553 loc) · 24.7 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
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JS Paint</title>
<link href="styles/normalize.css" rel="stylesheet" type="text/css">
<link href="styles/layout.css" class="flippable-layout-stylesheet" rel="stylesheet" type="text/css">
<link href="styles/print.css" rel="stylesheet" type="text/css" media="print">
<link href="lib/os-gui/layout.css" class="flippable-layout-stylesheet" rel="stylesheet" type="text/css">
<!-- <link href="lib/os-gui/windows-98.css" rel="stylesheet" type="text/css"> -->
<!-- <link href="lib/os-gui/windows-default.css" rel="stylesheet" type="text/css" title="Windows Default"> -->
<!-- <link href="lib/os-gui/peggys-pastels.css" rel="alternate stylesheet" type="text/css" title="Peggy's Pastels"> -->
<link rel="apple-touch-icon" href="images/icons/apple-icon-180x180.png">
<!-- Chrome will pick the largest image for some reason, instead of the most appropriate one. -->
<!-- <link rel="icon" type="image/png" sizes="192x192" href="images/icons/192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/icons/32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/icons/96x96.png"> -->
<!-- <link rel="icon" type="image/png" sizes="16x16" href="images/icons/16x16.png"> -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="mask-icon" href="images/icons/safari-pinned-tab.svg" color="red">
<link rel="manifest" href="manifest.webmanifest">
<meta name="msapplication-TileColor" content="#008080">
<meta name="msapplication-TileImage" content="images/icons/ms-icon-144x144.png">
<meta name="theme-color" content="#000080">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="description" content="Classic MS Paint in the browser, with extra features" />
<meta property="og:image:width" content="279">
<meta property="og:image:height" content="279">
<meta property="og:description" content="Classic MS Paint in the browser, with extra features.">
<meta property="og:title" content="JS Paint">
<meta property="og:url" content="https://jspaint.app">
<meta property="og:image" content="https://jspaint.app/images/icons/og-image-279x279.jpg">
<meta name="twitter:title" content="JS Paint">
<meta name="twitter:description" content="Classic MS Paint in the browser, with extra features">
<meta name="twitter:image" content="https://jspaint.app/images/meta/twitter-card-plz-no-crop.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@isaiahodhner">
<meta name="twitter:creator" content="@isaiahodhner">
<script src="src/theme.js"></script>
</head>
<body>
<div id="about-paint" hidden>
<div class="summary">
<h3>Welcome to CSCI 1230!</h3>
<p>
<span style='font-weight: bold;'>Lecture:</span> Tues & Thurs 10:30am -- 11:50am, Friedman 102 (lectures recorded for remote async participants)
<br/>
<span style='font-weight: bold;'>TA mailing list:</span> <a href='mailto:[email protected]'>[email protected]</a>
<br/>
<span style='font-weight: bold;'>Ed Discussion Board:</span> <a href="https://edstem.org/us/courses/12828">https://edstem.org/us/courses/12828</a>
</p>
<p>
This course offers an in-depth exploration of fundamental concepts in 2D and 3D computer graphics. It introduces 2D raster graphics techniques, including rasterization and simple image processing. The bulk of the course is devoted to 3D modeling, geometric transformations, and 3D viewing and rendering. C++ and the graphics library OpenGL are used during the course, as is shader programming on the GPU. The final project is typically a small group project spec'd and implemented by the group to create special effects.
</p>
<h3>Prerequisites</h3>
<p>
The official prerequisites for CSCI 1230 are CSCI 0150/0160, CSCI 0170/0180, or CSCI 0190. CSCI 0330, because it uses C, is very helpful but not strictly required. CSCI 0320, for its software design, is additionally helpful but not required. Some familiarity with C++ will be helpful, but help sessions and extra support will be offered to students who don't have any prior C++ experience. Some knowledge of basic linear algebra (i.e., vector and matrix multiplication, dot and cross products) may also be helpful, but none is required or assumed.
</p>
</div>
<style>
#about-paint {
background: white;
color: black;
}
.summary {
padding: 20px;
max-width: 563px;
}
</style>
</div>
<div id="news" hidden>
<div class="news entry">
<iframe src="https://calendar.google.com/calendar/embed?src=c_bo4h2c7ltabdsufks0ji3t2qoo%40group.calendar.google.com&ctz=America%2FNew_York" style="border:solid 1px #777" width="800" height="600" frameborder="0" scrolling="no"></iframe>
</div>
<style>
#news {
background: white;
color: black;
}
.news-entry {
padding: 20px;
max-width: 563px;
}
.news-entry > h1 {
font-size: 1.3em;
margin: 0;
margin-bottom: 0.3em;
}
.news-entry > time {
font-size: 1.2em;
color: gray;
}
.news-entry > h2 {
font-size: 1.9em;
font-weight: normal;
margin: 0;
margin-bottom: 0.3em;
margin-top: 0.3em;
}
.news-entry .new {
color: green;
}
.news-entry .bad {
color: #d11a29;
}
</style>
</div>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"
></script>
<script>
window.jQuery || document.write('<script src="lib/jquery-3.4.1.min.js"><\/script>');
</script>
<script>
// @TODO: DRY hotkey helpers
// & defines accelerators (hotkeys) in menus and buttons and things, which get underlined in the UI.
// & can be escaped by doubling it, e.g. "&Taskbar && Start Menu"
function index_of_hotkey(text) {
// Returns the index of the ampersand that defines a hotkey, or -1 if not present.
// return english_text.search(/(?<!&)&(?!&|\s)/); // not enough browser support for negative lookbehind assertions
// The space here handles beginning-of-string matching and counteracts the offset for the [^&] so it acts like a negative lookbehind
return ` ${text}`.search(/[^&]&[^&\s]/);
}
function has_hotkey(text) {
return index_of_hotkey(text) !== -1;
}
function remove_hotkey(text) {
return text.replace(/\s?\(&.\)/, "").replace(/([^&]|^)&([^&\s])/, "$1$2");
}
function display_hotkey(text) {
// misnomer: using .menu-hotkey out of lazyness, instead of a more general term like .hotkey or .accelerator
return text.replace(/([^&]|^)&([^&\s])/, "$1<span class='menu-hotkey'>$2</span>").replace(/&&/g, "&");
}
// function get_hotkey(text) {
// return text[index_of_hotkey(text) + 1].toUpperCase();
// }
let localizations = {};
window.localize = (english_text, ...interpolations)=> {
function find_localization(english_text) {
const amp_index = index_of_hotkey(english_text);
if (amp_index > -1) {
const without_hotkey = remove_hotkey(english_text);
if (localizations[without_hotkey]) {
const hotkey_def = english_text.slice(amp_index, amp_index + 2);
if (localizations[without_hotkey].toUpperCase().indexOf(hotkey_def.toUpperCase()) > -1) {
return localizations[without_hotkey];
} else {
if (has_hotkey(localizations[without_hotkey])) {
// window.console && console.warn(`Localization has differing accelerator (hotkey) hint: '${localizations[without_hotkey]}' vs '${english_text}'`);
// TODO: detect differing accelerator more generally
return `${remove_hotkey(localizations[without_hotkey])} (${hotkey_def})`;
}
return `${localizations[without_hotkey]} (${hotkey_def})`;
}
}
}
if (localizations[english_text]) {
return localizations[english_text];
}
return english_text;
}
function interpolate(text, interpolations) {
for (let i = 0; i < interpolations.length; i++) {
text = text.replace(`%${i+1}`, interpolations[i]);
}
return text;
}
return interpolate(find_localization(english_text), interpolations);
}
const language_storage_key = "jspaint language";
const accepted_languages = Array.from(navigator.languages || [navigator.language || navigator.userLanguage]);
try {
if (localStorage[language_storage_key]) {
accepted_languages.unshift(localStorage[language_storage_key]);
}
} catch (error) {}
const base_language = "en";
const available_languages = ["ar", "cs", "da", "de", "el", "en", "es", "fi", "fr", "he", "hu", "it", "ja", "ko", "nl", "no", "pl", "pt", "pt-br", "ru", "sk", "sl", "sv", "tr", "zh", "zh-simplified"];
const language_names = {
// "639-1": [["ISO language name"], ["Native name (endonym)"]],
ab: [["Abkhazian"], ["Аҧсуа Бызшәа", "Аҧсшәа"]],
aa: [["Afar"], ["Afaraf"]],
af: [["Afrikaans"], ["Afrikaans"]],
ak: [["Akan"], ["Akan"]],
sq: [["Albanian"], ["Shqip"]],
am: [["Amharic"], ["አማርኛ"]],
ar: [["Arabic"], ["العربية"]],
an: [["Aragonese"], ["Aragonés"]],
hy: [["Armenian"], ["Հայերեն"]],
as: [["Assamese"], ["অসমীয়া"]],
av: [["Avaric"], ["Авар МацӀ", "МагӀарул МацӀ"]],
ae: [["Avestan"], ["Avesta"]],
ay: [["Aymara"], ["Aymar Aru"]],
az: [["Azerbaijani"], ["Azərbaycan Dili"]],
bm: [["Bambara"], ["Bamanankan"]],
ba: [["Bashkir"], ["Башҡорт Теле"]],
eu: [["Basque"], ["Euskara", "Euskera"]],
be: [["Belarusian"], ["Беларуская Мова"]],
bn: [["Bengali"], ["বাংলা"]],
bh: [["Bihari Languages"], ["भोजपुरी"]],
bi: [["Bislama"], ["Bislama"]],
bs: [["Bosnian"], ["Bosanski Jezik"]],
br: [["Breton"], ["Brezhoneg"]],
bg: [["Bulgarian"], ["Български Език"]],
my: [["Burmese"], ["ဗမာစာ"]],
ca: [["Catalan", "Valencian"], ["Català", "Valencià"]],
ch: [["Chamorro"], ["Chamoru"]],
ce: [["Chechen"], ["Нохчийн Мотт"]],
ny: [["Chichewa", "Chewa", "Nyanja"], ["ChiCheŵa", "Chinyanja"]],
// zh: [["Chinese"], ["中文", "Zhōngwén", "汉语", "漢語"]],
// The ISO 639-1 code "zh" doesn't refer to Traditional Chinese specifically,
// but we want to show the distinction between Chinese varieties in the Language menu,
// so this is overly specific for now.
// @TODO: do this cleaner by establishing a mapping between ISO codes (such as "zh") and default language IDs (such as "zh-traditional")
zh: [["Traditional Chinese"], ["繁體中文", "傳統中文", "正體中文", "繁体中文"]],
"zh-traditional": [["Traditional Chinese"], ["繁體中文", "傳統中文", "正體中文", "繁体中文"]], // made-up ID, not real ISO 639-1
"zh-simplified": [["Simple Chinese"], ["简体中文"]], // made-up ID, not real ISO 639-1
cv: [["Chuvash"], ["Чӑваш Чӗлхи"]],
kw: [["Cornish"], ["Kernewek"]],
co: [["Corsican"], ["Corsu", "Lingua Corsa"]],
cr: [["Cree"], ["ᓀᐦᐃᔭᐍᐏᐣ"]],
hr: [["Croatian"], ["Hrvatski Jezik"]],
cs: [["Czech"], ["Čeština", "Český Jazyk"]],
da: [["Danish"], ["Dansk"]],
dv: [["Divehi", "Dhivehi", "Maldivian"], ["ދިވެހި"]],
nl: [["Dutch", "Flemish"], ["Nederlands", "Vlaams"]],
dz: [["Dzongkha"], ["རྫོང་ཁ"]],
en: [["English"], ["English"]],
eo: [["Esperanto"], ["Esperanto"]],
et: [["Estonian"], ["Eesti", "Eesti Keel"]],
ee: [["Ewe"], ["Eʋegbe"]],
fo: [["Faroese"], ["Føroyskt"]],
fj: [["Fijian"], ["Vosa Vakaviti"]],
fi: [["Finnish"], ["Suomi", "Suomen Kieli"]],
fr: [["French"], ["Français", "Langue Française"]],
ff: [["Fulah"], ["Fulfulde", "Pulaar", "Pular"]],
gl: [["Galician"], ["Galego"]],
ka: [["Georgian"], ["ქართული"]],
de: [["German"], ["Deutsch"]],
el: [["Greek"], ["Ελληνικά"]],
gn: [["Guarani"], ["Avañe'ẽ"]],
gu: [["Gujarati"], ["ગુજરાતી"]],
ht: [["Haitian", "Haitian Creole"], ["Kreyòl Ayisyen"]],
ha: [["Hausa"], ["هَوُسَ"]],
he: [["Hebrew"], ["עברית"]],
hz: [["Herero"], ["Otjiherero"]],
hi: [["Hindi"], ["हिन्दी", "हिंदी"]],
ho: [["Hiri Motu"], ["Hiri Motu"]],
hu: [["Hungarian"], ["Magyar"]],
ia: [["Interlingua"], ["Interlingua"]],
id: [["Indonesian"], ["Bahasa Indonesia"]],
ie: [["Interlingue", "Occidental"], ["Interlingue", "Occidental"]],
ga: [["Irish"], ["Gaeilge"]],
ig: [["Igbo"], ["Asụsụ Igbo"]],
ik: [["Inupiaq"], ["Iñupiaq", "Iñupiatun"]],
io: [["Ido"], ["Ido"]],
is: [["Icelandic"], ["Íslenska"]],
it: [["Italian"], ["Italiano"]],
iu: [["Inuktitut"], ["ᐃᓄᒃᑎᑐᑦ"]],
ja: [["Japanese"], ["日本語", "にほんご"]],
jv: [["Javanese"], ["ꦧꦱꦗꦮ", "Basa Jawa"]],
kl: [["Kalaallisut", "Greenlandic"], ["Kalaallisut", "Kalaallit Oqaasii"]],
kn: [["Kannada"], ["ಕನ್ನಡ"]],
kr: [["Kanuri"], ["Kanuri"]],
ks: [["Kashmiri"], ["कश्मीरी", "كشميري"]],
kk: [["Kazakh"], ["Қазақ Тілі"]],
km: [["Central Khmer"], ["ខ្មែរ", "ខេមរភាសា", "ភាសាខ្មែរ"]],
ki: [["Kikuyu", "Gikuyu"], ["Gĩkũyũ"]],
rw: [["Kinyarwanda"], ["Ikinyarwanda"]],
ky: [["Kirghiz", "Kyrgyz"], ["Кыргызча", "Кыргыз Тили"]],
kv: [["Komi"], ["Коми Кыв"]],
kg: [["Kongo"], ["Kikongo"]],
ko: [["Korean"], ["한국어"]],
ku: [["Kurdish"], ["Kurdî", "کوردی"]],
kj: [["Kuanyama", "Kwanyama"], ["Kuanyama"]],
la: [["Latin"], ["Latine", "Lingua Latina"]],
lb: [["Luxembourgish", "Letzeburgesch"], ["Lëtzebuergesch"]],
lg: [["Ganda"], ["Luganda"]],
li: [["Limburgan", "Limburger", "Limburgish"], ["Limburgs"]],
ln: [["Lingala"], ["Lingála"]],
lo: [["Lao"], ["ພາສາລາວ"]],
lt: [["Lithuanian"], ["Lietuvių Kalba"]],
lu: [["Luba-Katanga"], ["Kiluba"]],
lv: [["Latvian"], ["Latviešu Valoda"]],
gv: [["Manx"], ["Gaelg", "Gailck"]],
mk: [["Macedonian"], ["Македонски Јазик"]],
mg: [["Malagasy"], ["Fiteny Malagasy"]],
ms: [["Malay"], ["Bahasa Melayu", "بهاس ملايو"]],
ml: [["Malayalam"], ["മലയാളം"]],
mt: [["Maltese"], ["Malti"]],
mi: [["Maori"], ["Te Reo Māori"]],
mr: [["Marathi"], ["मराठी"]],
mh: [["Marshallese"], ["Kajin M̧ajeļ"]],
mn: [["Mongolian"], ["Монгол Хэл"]],
na: [["Nauru"], ["Dorerin Naoero"]],
nv: [["Navajo", "Navaho"], ["Diné Bizaad"]],
nd: [["North Ndebele"], ["IsiNdebele"]],
ne: [["Nepali"], ["नेपाली"]],
ng: [["Ndonga"], ["Owambo"]],
nb: [["Norwegian Bokmål"], ["Norsk Bokmål"]],
nn: [["Norwegian Nynorsk"], ["Norsk Nynorsk"]],
no: [["Norwegian"], ["Norsk"]],
ii: [["Sichuan Yi", "Nuosu"], ["ꆈꌠ꒿", "Nuosuhxop"]],
nr: [["South Ndebele"], ["IsiNdebele"]],
oc: [["Occitan"], ["Occitan", "Lenga d'Òc"]],
oj: [["Ojibwa"], ["ᐊᓂᔑᓈᐯᒧᐎᓐ"]],
cu: [["Church Slavic", "Old Slavonic", "Church Slavonic", "Old Bulgarian", "Old Church Slavonic"], ["Ѩзыкъ Словѣньскъ"]],
om: [["Oromo"], ["Afaan Oromoo"]],
or: [["Oriya"], ["ଓଡ଼ିଆ"]],
os: [["Ossetian", "Ossetic"], ["Ирон Æвзаг"]],
pa: [["Punjabi", "Panjabi"], ["ਪੰਜਾਬੀ", "پنجابی"]],
pi: [["Pali"], ["पालि", "पाळि"]],
fa: [["Persian"], ["فارسی"]],
pl: [["Polish"], ["Język Polski", "Polszczyzna"]],
ps: [["Pashto", "Pushto"], ["پښتو"]],
pt: [["Portuguese"], ["Português"]],
"pt-br": [["Brazilian Portuguese"], ["Português Brasileiro"]],
"pt-pt": [["Portuguese (Portugal)"], ["Português De Portugal"]],
qu: [["Quechua"], ["Runa Simi", "Kichwa"]],
rm: [["Romansh"], ["Rumantsch Grischun"]],
rn: [["Rundi"], ["Ikirundi"]],
ro: [["Romanian", "Moldavian", "Moldovan"], ["Română"]],
ru: [["Russian"], ["Русский"]],
sa: [["Sanskrit"], ["संस्कृतम्"]],
sc: [["Sardinian"], ["Sardu"]],
sd: [["Sindhi"], ["सिन्धी", "سنڌي، سندھی"]],
se: [["Northern Sami"], ["Davvisámegiella"]],
sm: [["Samoan"], ["Gagana Fa'a Samoa"]],
sg: [["Sango"], ["Yângâ Tî Sängö"]],
sr: [["Serbian"], ["Српски Језик"]],
gd: [["Gaelic", "Scottish Gaelic"], ["Gàidhlig"]],
sn: [["Shona"], ["ChiShona"]],
si: [["Sinhala", "Sinhalese"], ["සිංහල"]],
sk: [["Slovak"], ["Slovenčina", "Slovenský Jazyk"]],
sl: [["Slovenian"], ["Slovenski Jezik", "Slovenščina"]],
so: [["Somali"], ["Soomaaliga", "Af Soomaali"]],
st: [["Southern Sotho"], ["Sesotho"]],
es: [["Spanish", "Castilian"], ["Español"]],
su: [["Sundanese"], ["Basa Sunda"]],
sw: [["Swahili"], ["Kiswahili"]],
ss: [["Swati"], ["SiSwati"]],
sv: [["Swedish"], ["Svenska"]],
ta: [["Tamil"], ["தமிழ்"]],
te: [["Telugu"], ["తెలుగు"]],
tg: [["Tajik"], ["Тоҷикӣ", "Toçikī", "تاجیکی"]],
th: [["Thai"], ["ไทย"]],
ti: [["Tigrinya"], ["ትግርኛ"]],
bo: [["Tibetan"], ["བོད་ཡིག"]],
tk: [["Turkmen"], ["Türkmen", "Түркмен"]],
tl: [["Tagalog"], ["Wikang Tagalog"]],
tn: [["Tswana"], ["Setswana"]],
to: [["Tonga"], ["Faka Tonga"]],
tr: [["Turkish"], ["Türkçe"]],
ts: [["Tsonga"], ["Xitsonga"]],
tt: [["Tatar"], ["Татар Теле", "Tatar Tele"]],
tw: [["Twi"], ["Twi"]],
ty: [["Tahitian"], ["Reo Tahiti"]],
ug: [["Uighur", "Uyghur"], ["ئۇيغۇرچە", "Uyghurche"]],
uk: [["Ukrainian"], ["Українська"]],
ur: [["Urdu"], ["اردو"]],
uz: [["Uzbek"], ["Oʻzbek", "Ўзбек", "أۇزبېك"]],
ve: [["Venda"], ["Tshivenḓa"]],
vi: [["Vietnamese"], ["Tiếng Việt"]],
vo: [["Volapük"], ["Volapük"]],
wa: [["Walloon"], ["Walon"]],
cy: [["Welsh"], ["Cymraeg"]],
wo: [["Wolof"], ["Wollof"]],
fy: [["Western Frisian"], ["Frysk"]],
xh: [["Xhosa"], ["IsiXhosa"]],
yi: [["Yiddish"], ["ייִדיש"]],
yo: [["Yoruba"], ["Yorùbá"]],
za: [["Zhuang", "Chuang"], ["Saɯ Cueŋƅ", "Saw Cuengh"]],
zu: [["Zulu"], ["IsiZulu"]],
};
function get_iso_language_name(language) {
return language_names[language][0][0];
}
function get_endonym(language) {
return language_names[language][1][0];
}
let current_language = base_language;
for (const accepted_language of accepted_languages) {
if (available_languages.indexOf(accepted_language) !== -1) {
current_language = accepted_language;
break;
}
}
function get_language() {
return current_language;
}
function get_direction(language=current_language) {
return current_language.match(/^(ar|dv|fa|ha|he|ks|ku|ms|pa|ps|sd|ug|yi)\b/i) ? "rtl" : "ltr";
}
function load_language(language) {
const prev_language = current_language;
const stylesheets = [...document.querySelectorAll(".flippable-layout-stylesheet")];
for (const stylesheet of stylesheets) {
let href = stylesheet.getAttribute("href");
if (get_direction(language) === "rtl") {
if (href.indexOf(".rtl.css") === -1) {
href = href.replace(/\.css/i, ".rtl.css");
}
} else {
if (href.indexOf(".rtl.css") > -1) {
href = href.replace(/\.rtl\.css/i, ".css");
}
}
stylesheet.setAttribute("href", href);
// hack to wait for stylesheet to load
const img = document.createElement("img");
img.onerror = ()=> {
$(()=> {
$G.triggerHandler("theme-load"); // signal layout change
});
};
img.src = href;
}
if (language === base_language) {
localizations = {};
current_language = base_language;
return;
}
// fetch(`localization/${language}/localizations.json`)
// .then((response)=> response.json())
// .then((new_localizations)=> {
// localizations = new_localizations;
// current_language = language;
// }).catch((error)=> {
// show_error_message(`Failed to load localizations for ${language_names[language]}.`, error);
// current_language = prev_language;
// });
const src = `localization/${language}/localizations.js`;
document.write(`<script src="${src}"><\/script>`);
}
// JSONP callback
function loaded_localizations(language, mapping) {
localizations = mapping;
current_language = language;
}
function set_language(language) {
const $w = $FormToolWindow().title("Reload Required").addClass("dialogue-window squish");
$w.$main.text("The application needs to reload to change the language.");
$w.$main.css("max-width", "600px");
$w.$Button(localize("OK"), () => {
$w.close();
are_you_sure(() => {
try {
localStorage[language_storage_key] = language;
location.reload();
} catch(error) {
show_error_message("Failed to store language preference. Make sure cookies / local storage is enabled in your browser settings.", error);
}
});
});
$w.$Button(localize("Cancel"), () => {
$w.close();
});
$w.center();
// load_language(language);
}
load_language(current_language);
</script>
<script src="lib/pep.js"></script>
<script src="lib/canvas.toBlob.js"></script>
<script src="lib/gif.js/gif.js"></script>
<script src="lib/anypalette-0.6.0.js"></script>
<script src="lib/FileSaver.js"></script>
<script src="lib/font-detective.js"></script>
<script src="lib/libtess.min.js"></script>
<script src="lib/os-gui/parse-theme.js"></script>
<script src="lib/os-gui/$Window.js"></script>
<script src="lib/os-gui/$MenuBar.js"></script>
<script src="lib/imagetracer_v1.2.5.js"></script>
<script src="src/functions.js"></script>
<script src="src/helpers.js"></script>
<script src="src/storage.js"></script>
<script src="src/$Component.js"></script>
<script src="src/$ToolWindow.js"></script>
<script src="src/MinimizeWindow.js"></script>
<script src="src/$ToolBox.js"></script>
<script src="src/$ColorBox.js"></script>
<script src="src/$FontBox.js"></script>
<script src="src/$Handles.js"></script>
<script src="src/OnCanvasObject.js"></script>
<script src="src/OnCanvasSelection.js"></script>
<script src="src/OnCanvasTextBox.js"></script>
<script src="src/OnCanvasHelperLayer.js"></script>
<script src="src/image-manipulation.js"></script>
<script src="src/tool-options.js"></script>
<script src="src/tools.js"></script>
<!--<script src="src/extra-tools.js"></script>-->
<script src="src/edit-colors.js"></script>
<script src="src/manage-storage.js"></script>
<script src="src/imgur.js"></script>
<script src="src/window.js"></script>
<script src="src/simulate-random-gestures.js"></script>
<script src="src/menus.js"></script>
<script src="src/speech-recognition.js"></script>
<script src="src/app.js"></script>
<script src="src/sessions.js"></script>
<script src="lib/konami.js"></script>
<script src="src/vaporwave-fun.js"></script>
<script>
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)){
document.write(
'<style>body { text-align: center; }</style>' +
'<div className="not-supported">' +
'<h1 className="not-supported-header">Internet Explorer is not supported!</h1>' +
'<p className="not-supported-details">Try Chrome, Firefox, or Edge.</p>' +
'</div>'
);
}
</script>
<noscript>
<h1><img src="images/icons/32x32.png" width="32" height="32" alt=""/> JS Paint</h1>
<p>This application requires JavaScript to run.</p>
<p>
Assuming this is the official instance of jspaint,
at <a href="https://jspaint.app">https://jspaint.app</a>,
you can safely enable JavaScript.
</p>
<p>You can also check out <a href="https://github.com/1j01/jspaint">the source code and project info</a>.</p>
</noscript>
<svg style="position: absolute; pointer-events: none; bottom: 100%;">
<defs>
<filter id="disabled-inset-filter" x="0" y="0" width="1px" height="1px">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
-1000 -1000 -1000 1 0
"
result="black-parts-isolated"
/>
<feFlood result="shadow-color" flood-color="var(--ButtonShadow)"/>
<feFlood result="hilight-color" flood-color="var(--ButtonHilight)"/>
<feOffset in="black-parts-isolated" dx="1" dy="1" result="offset"/>
<feComposite in="hilight-color" in2="offset" operator="in" result="hilight-colored-offset"/>
<feComposite in="shadow-color" in2="black-parts-isolated" operator="in" result="shadow-colored"/>
<feMerge>
<feMergeNode in="hilight-colored-offset"/>
<feMergeNode in="shadow-colored"/>
</feMerge>
</filter>
</defs>
</svg>
</body>
</html>