Browse Source

Create makefile to organize workflow

master
haskal 2 months ago
parent
commit
a68b25675c
3 changed files with 20 additions and 861 deletions
  1. 3
    0
      .gitignore
  2. 17
    0
      Makefile
  3. 0
    861
      js-compiled.js

+ 3
- 0
.gitignore View File

@@ -4,3 +4,6 @@ closure-library/*
4 4
 *~
5 5
 _site/*
6 6
 .DS_Store
7
+
8
+js-compiled.js
9
+release.tar.xz

+ 17
- 0
Makefile View File

@@ -0,0 +1,17 @@
1
+.PHONY: all package clean
2
+
3
+JS_LIB = $(wildcard js-lib/* js-lib/**/*)
4
+IMG = $(wildcard images/*)
5
+
6
+all: js-compiled.js
7
+
8
+js-compiled.js: $(JS_LIB) jquery-3.1-externs.js
9
+	./compile.sh
10
+
11
+package: release.tar.xz
12
+
13
+release.tar.xz: js-compiled.js index.html $(IMG) addtohomescreen.css addtohomescreen.min.js jquery-3.1.1.min.js
14
+	tar czvf $@ $^
15
+
16
+clean:
17
+	$(RM) js-compiled.js release.tar.xz

+ 0
- 861
js-compiled.js View File

@@ -1,861 +0,0 @@
1
-var g, aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, c, b) {
2
-  if (b.get || b.set) {
3
-    throw new TypeError("ES3 does not support getters and setters.");
4
-  }
5
-  a != Array.prototype && a != Object.prototype && (a[c] = b.value);
6
-}, h = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this;
7
-function ba() {
8
-  ba = function() {
9
-  };
10
-  h.Symbol || (h.Symbol = ca);
11
-}
12
-var da = 0;
13
-function ca(a) {
14
-  return "jscomp_symbol_" + (a || "") + da++;
15
-}
16
-function m() {
17
-  ba();
18
-  var a = h.Symbol.iterator;
19
-  a || (a = h.Symbol.iterator = h.Symbol("iterator"));
20
-  "function" != typeof Array.prototype[a] && aa(Array.prototype, a, {configurable:!0, writable:!0, value:function() {
21
-    return ea(this);
22
-  }});
23
-  m = function() {
24
-  };
25
-}
26
-function ea(a) {
27
-  var c = 0;
28
-  return fa(function() {
29
-    return c < a.length ? {done:!1, value:a[c++]} : {done:!0};
30
-  });
31
-}
32
-function fa(a) {
33
-  m();
34
-  a = {next:a};
35
-  a[h.Symbol.iterator] = function() {
36
-    return this;
37
-  };
38
-  return a;
39
-}
40
-function n(a) {
41
-  m();
42
-  var c = a[Symbol.iterator];
43
-  return c ? c.call(a) : ea(a);
44
-}
45
-function p(a, c) {
46
-  this.x = a;
47
-  this.y = c;
48
-}
49
-function r(a, c) {
50
-  var b = a.originalEvent.touches[void 0 === c ? 0 : c];
51
-  return new p(b.pageX, b.pageY);
52
-}
53
-function t(a, c) {
54
-  return !!c && a.x == c.x && a.y == c.y;
55
-}
56
-function u(a, c) {
57
-  return new p(a.x - c.x, a.y - c.y);
58
-}
59
-g = p.prototype;
60
-g.add = function(a) {
61
-  return new p(this.x + a.x, this.y + a.y);
62
-};
63
-g.clone = function() {
64
-  return new p(this.x, this.y);
65
-};
66
-g.length = function() {
67
-  return Math.sqrt(this.x * this.x + this.y * this.y);
68
-};
69
-g.scale = function(a) {
70
-  return new p(this.x * a, this.y * a);
71
-};
72
-function w(a) {
73
-  return new p(a.x, a.y - 1);
74
-}
75
-function x(a) {
76
-  return new p(a.x, a.y + 1);
77
-}
78
-function y(a) {
79
-  return new p(a.x - 1, a.y);
80
-}
81
-g.right = function(a) {
82
-  return new p(this.x + (void 0 === a ? 1 : a), this.y);
83
-};
84
-var z = ["+", "\u2012", "\u2013", "-", "|"], A = [">", "<", "^", "v"], ga = z.concat(A), B = "ontouchstart" in window || "onmsgesturechange" in window, C = new p(-1, 0), E = new p(1, 0), F = new p(0, -1), G = new p(0, 1), H = [C, E, F, G];
85
-function I(a, c) {
86
-  this.a = Math.min(a.x, c.x);
87
-  this.b = Math.min(a.y, c.y);
88
-  this.c = Math.max(a.x, c.x);
89
-  this.f = Math.max(a.y, c.y);
90
-}
91
-function ha(a) {
92
-  return new p(a.a, a.b);
93
-}
94
-I.prototype.contains = function(a) {
95
-  return a.x >= this.a && a.x <= this.c && a.y >= this.b && a.y <= this.f;
96
-};
97
-function ia() {
98
-  this.a = this.value = null;
99
-}
100
-function J(a) {
101
-  return null != a.a ? a.a : a.value;
102
-}
103
-function L(a) {
104
-  return ga.includes(J(a));
105
-}
106
-function M(a) {
107
-  return null == a.value && null == a.a;
108
-}
109
-function ja(a, c, b, e) {
110
-  this.a = a;
111
-  this.right = c;
112
-  this.c = b;
113
-  this.b = e;
114
-  this.h = this.f = this.l = this.g = !1;
115
-}
116
-function N(a) {
117
-  return a.a + a.right + a.c + a.b;
118
-}
119
-function ka(a, c) {
120
-  this.position = a;
121
-  this.value = c;
122
-}
123
-function la(a, c) {
124
-  this.position = a;
125
-  this.a = c;
126
-}
127
-;function ma(a) {
128
-  for (var c = 0;c < a.a.length;c++) {
129
-    for (var b = 0;b < a.a[c].length;b++) {
130
-      null != J(a.a[c][b]) && O(a, new p(c, b), "\u2009");
131
-    }
132
-  }
133
-  P(a);
134
-}
135
-function Q(a, c) {
136
-  return a.a[c.x][c.y];
137
-}
138
-function O(a, c, b) {
139
-  var e = Q(a, c);
140
-  a.b.push(new la(c, e));
141
-  e.a = b;
142
-  a.c = !0;
143
-}
144
-function R(a, c, b) {
145
-  J(Q(a, c)) != b && O(a, c, b);
146
-}
147
-function S(a) {
148
-  for (var c = n(a.b), b = c.next();!b.done;b = c.next()) {
149
-    b.value.a.a = null;
150
-  }
151
-  a.b.length = 0;
152
-}
153
-function T(a, c) {
154
-  var b = Q(a, c), e = null != b.a ? b.a : b.value, d = z.includes(e), f = A.includes(e);
155
-  if (!d && !f) {
156
-    return e;
157
-  }
158
-  b = U(a, c);
159
-  if (d && b.a && b.right && !b.c && !b.b) {
160
-    return "-";
161
-  }
162
-  if (d && !b.a && !b.right && b.c && b.b) {
163
-    return "|";
164
-  }
165
-  if (4 == N(b)) {
166
-    return "-";
167
-  }
168
-  if (f && 3 == N(b)) {
169
-    if (!b.a) {
170
-      return "<";
171
-    }
172
-    if (!b.c) {
173
-      return "^";
174
-    }
175
-    if (!b.b) {
176
-      return "v";
177
-    }
178
-    if (!b.right) {
179
-      return ">";
180
-    }
181
-  }
182
-  if ((d || f) && 3 == N(b)) {
183
-    b.g = L(Q(a, w(y(c))));
184
-    b.l = L(Q(a, w(c.right())));
185
-    b.f = L(Q(a, x(y(c))));
186
-    b.h = L(Q(a, x(c.right())));
187
-    if (!b.right && b.g && b.f || !b.a && b.l && b.h) {
188
-      return "|";
189
-    }
190
-    if (!b.b && b.g && b.l || !b.c && b.h && b.f) {
191
-      return "-";
192
-    }
193
-    e = M(Q(a, w(y(c))));
194
-    d = M(Q(a, w(c.right())));
195
-    if (b.c && b.a && b.right && (!e || !d)) {
196
-      return "-";
197
-    }
198
-    e = M(Q(a, x(y(c))));
199
-    d = M(Q(a, x(c.right())));
200
-    return !(b.b && b.a && b.right) || e && d ? "+" : "-";
201
-  }
202
-  if (f && 1 == N(b)) {
203
-    if (b.a) {
204
-      return ">";
205
-    }
206
-    if (b.c) {
207
-      return "v";
208
-    }
209
-    if (b.b) {
210
-      return "^";
211
-    }
212
-    if (b.right) {
213
-      return "<";
214
-    }
215
-  }
216
-  return e;
217
-}
218
-function U(a, c) {
219
-  var b = L(Q(a, y(c))), e = L(Q(a, c.right())), d = L(Q(a, w(c))), f = L(Q(a, x(c)));
220
-  return new ja(b, e, d, f);
221
-}
222
-function P(a, c) {
223
-  var b = [], e = a.b.map(function(a) {
224
-    return a.position.x.toString() + a.position.y.toString();
225
-  }), d = a.b.filter(function(a, b) {
226
-    return e.indexOf(e[b]) == b;
227
-  });
228
-  a.b.length = 0;
229
-  for (var d = n(d), f = d.next();!f.done;f = d.next()) {
230
-    var k = f.value, f = k.position, k = k.a;
231
-    b.push(new ka(f, null != k.value ? k.value : " "));
232
-    var l = J(k);
233
-    if ("\u2009" == l || " " == l) {
234
-      l = null;
235
-    }
236
-    L(k) && (l = T(a, f));
237
-    k.a = null;
238
-    k.value = l;
239
-  }
240
-  d = c ? a.f : a.g;
241
-  0 < b.length && (50 < d.length && d.shift(), d.push(b));
242
-  a.c = !0;
243
-}
244
-function na(a) {
245
-  if (a.g.length) {
246
-    for (var c = a.g.pop(), c = n(c), b = c.next();!b.done;b = c.next()) {
247
-      b = b.value, O(a, b.position, b.value);
248
-    }
249
-    P(a, !0);
250
-  }
251
-}
252
-function oa(a) {
253
-  if (a.f.length) {
254
-    for (var c = a.f.pop(), c = n(c), b = c.next();!b.done;b = c.next()) {
255
-      b = b.value, O(a, b.position, b.value);
256
-    }
257
-    P(a);
258
-  }
259
-}
260
-function pa(a) {
261
-  for (var c = new p(Number.MAX_VALUE, Number.MAX_VALUE), b = new p(-1, -1), e = 0;e < a.a.length;e++) {
262
-    for (var d = 0;d < a.a[e].length;d++) {
263
-      null != J(a.a[e][d]) && (e < c.x && (c.x = e), d < c.y && (c.y = d), e > b.x && (b.x = e), d > b.y && (b.y = d));
264
-    }
265
-  }
266
-  if (0 > b.x) {
267
-    return "";
268
-  }
269
-  for (var f = "", d = c.y;d <= b.y;d++) {
270
-    for (var k = "", e = c.x;e <= b.x;e++) {
271
-      var l = T(a, new p(e, d)), k = k + (null == l || "\u2009" == l ? " " : l);
272
-    }
273
-    f += k.replace(/\s+$/, "") + "\n";
274
-  }
275
-  return f;
276
-}
277
-;function V(a, c, b, e, d) {
278
-  d = void 0 === d ? "+" : d;
279
-  var f = new I(c, b), k = f.a, l = f.b, v = f.c, f = f.f, D = e ? b.x : c.x;
280
-  for (e = e ? c.y : b.y;k++ < v;) {
281
-    var q = new p(k, e), K = U(a, new p(k, e));
282
-    " " == d && 2 == K.c + K.b || R(a, q, d);
283
-  }
284
-  for (;l++ < f;) {
285
-    q = new p(D, l), K = U(a, new p(D, l)), " " == d && 2 == K.a + K.right || R(a, q, d);
286
-  }
287
-  O(a, c, d);
288
-  O(a, b, d);
289
-  R(a, new p(D, e), d);
290
-}
291
-;function W(a) {
292
-  this.a = a;
293
-  this.b = null;
294
-}
295
-g = W.prototype;
296
-g.start = function(a) {
297
-  this.b = a;
298
-};
299
-g.i = function(a) {
300
-  S(this.a);
301
-  V(this.a, this.b, a, !0);
302
-  V(this.a, this.b, a, !1);
303
-};
304
-g.m = function() {
305
-  P(this.a);
306
-};
307
-g.o = function() {
308
-  return "crosshair";
309
-};
310
-g.j = function() {
311
-};
312
-function qa(a) {
313
-  a.b.width = document.documentElement.clientWidth;
314
-  a.b.height = document.documentElement.clientHeight;
315
-  a.f = !0;
316
-}
317
-function ra(a) {
318
-  if (a.f || a.g.c) {
319
-    a.f = !1, a.g.c = !1, sa(a);
320
-  }
321
-  window.requestAnimationFrame(function() {
322
-    ra(a);
323
-  });
324
-}
325
-function sa(a) {
326
-  var c = a.context;
327
-  c.setTransform(1, 0, 0, 1, 0, 0);
328
-  c.clearRect(0, 0, a.b.width, a.b.height);
329
-  c.scale(a.c, a.c);
330
-  c.translate(a.b.width / 2 / a.c, a.b.height / 2 / a.c);
331
-  var b = u(X(a, new p(0, 0)), new p(3, 3)), e = X(a, new p(a.b.width, a.b.height)).add(new p(3, 3));
332
-  b.x = Math.max(0, Math.min(b.x, 2E3));
333
-  e.x = Math.max(0, Math.min(e.x, 2E3));
334
-  b.y = Math.max(0, Math.min(b.y, 600));
335
-  e.y = Math.max(0, Math.min(e.y, 600));
336
-  c.lineWidth = "1";
337
-  c.strokeStyle = "#EEEEEE";
338
-  c.beginPath();
339
-  for (var d = b.x;d < e.x;d++) {
340
-    c.moveTo(9 * d - a.a.x, 0 - a.a.y), c.lineTo(9 * d - a.a.x, 17 * a.g.a.length - a.a.y);
341
-  }
342
-  for (d = b.y;d < e.y;d++) {
343
-    c.moveTo(0 - a.a.x, 17 * d - a.a.y), c.lineTo(9 * a.g.a.length - a.a.x, 17 * d - a.a.y);
344
-  }
345
-  a.context.stroke();
346
-  d = !a.h;
347
-  c.font = "15px Courier New";
348
-  for (var f = b.x;f < e.x;f++) {
349
-    for (var k = b.y;k < e.y;k++) {
350
-      var l = Q(a.g, new p(f, k));
351
-      if (L(l) || null != l.a && " " != J(l)) {
352
-        a.context.fillStyle = null != l.a ? "#DEF" : "#F5F5F5", c.fillRect(9 * f - a.a.x, 17 * (k - 1) - a.a.y, 9, 17);
353
-      }
354
-      var v = T(a.g, new p(f, k));
355
-      null == v || L(l) && !d || (a.context.fillStyle = "#000000", c.fillText(v, 9 * f - a.a.x, 17 * k - a.a.y - 3));
356
-    }
357
-  }
358
-  if (a.h) {
359
-    c.lineWidth = "1";
360
-    c.strokeStyle = "#000000";
361
-    c.beginPath();
362
-    for (d = b.x;d < e.x;d++) {
363
-      for (l = !1, f = b.y;f < e.y;f++) {
364
-        k = Q(a.g, new p(d, f)), L(k) && f != e.y - 1 || !l || (c.moveTo(9 * d - a.a.x + 4.5, 17 * l - a.a.y - 8.5), c.lineTo(9 * d - a.a.x + 4.5, 17 * (f - 1) - a.a.y - 8.5), l = !1), L(k) && !l && (l = f);
365
-      }
366
-    }
367
-    for (f = b.y;f < e.y;f++) {
368
-      for (l = !1, d = b.x;d < e.x;d++) {
369
-        k = Q(a.g, new p(d, f)), L(k) && d != e.x - 1 || !l || (c.moveTo(9 * l - a.a.x + 4.5, 17 * f - a.a.y - 8.5), c.lineTo(9 * (d - 1) - a.a.x + 4.5, 17 * f - a.a.y - 8.5), l = !1), L(k) && !l && (l = d);
370
-      }
371
-    }
372
-    a.context.stroke();
373
-  }
374
-}
375
-function X(a, c) {
376
-  var b = new p((c.x - a.b.width / 2) / a.c + a.a.x, (c.y - a.b.height / 2) / a.c + a.a.y);
377
-  return new p(Math.min(Math.max(1, Math.round((b.x - 4.5) / 9)), 1998), Math.min(Math.max(1, Math.round((b.y + 8.5) / 17)), 598));
378
-}
379
-;function Y(a) {
380
-  this.c = a;
381
-  this.a = this.b = null;
382
-}
383
-g = Y.prototype;
384
-g.start = function(a) {
385
-  this.b = a;
386
-  this.i(a);
387
-};
388
-g.i = function(a) {
389
-  S(this.c);
390
-  this.a = a;
391
-  a = Math.min(this.b.y, this.a.y);
392
-  for (var c = Math.max(this.b.x, this.a.x), b = Math.max(this.b.y, this.a.y), e = Math.min(this.b.x, this.a.x);e <= c;e++) {
393
-    for (var d = a;d <= b;d++) {
394
-      O(this.c, new p(e, d), "\u2009");
395
-    }
396
-  }
397
-};
398
-g.m = function() {
399
-  P(this.c);
400
-};
401
-g.o = function() {
402
-  return "crosshair";
403
-};
404
-g.j = function() {
405
-};
406
-function ta(a, c) {
407
-  this.a = a;
408
-  this.c = c;
409
-  this.b = null;
410
-}
411
-g = ta.prototype;
412
-g.start = function(a) {
413
-  this.b = a;
414
-};
415
-g.i = function(a) {
416
-  S(this.a);
417
-  var c = U(this.a, this.b), b = U(this.a, a);
418
-  V(this.a, this.b, a, c.c && c.b || b.a && b.right);
419
-  this.c && O(this.a, a, b.c ? "^" : b.b ? "v" : b.a ? "<" : ">");
420
-};
421
-g.m = function() {
422
-  P(this.a);
423
-};
424
-g.o = function() {
425
-  return "crosshair";
426
-};
427
-g.j = function() {
428
-};
429
-function ua(a) {
430
-  this.c = a;
431
-  this.g = this.f = this.b = this.a = null;
432
-  this.h = !0;
433
-  this.l = [];
434
-}
435
-g = ua.prototype;
436
-g.start = function(a) {
437
-  this.a && this.b && (new I(this.a, this.b)).contains(a) ? (this.f = a, va(this), wa(this, a)) : (this.a = a, this.b = null, this.h = !1, this.i(a));
438
-};
439
-function va(a) {
440
-  var c = a.c.b.filter(function(a) {
441
-    return null != J(a.a) && "\u2009" != J(a.a);
442
-  }), b = ha(new I(a.a, a.b));
443
-  a.l = c.map(function(a) {
444
-    return new ka(u(a.position, b), J(a.a));
445
-  });
446
-}
447
-g.i = function(a) {
448
-  if (this.f) {
449
-    wa(this, a);
450
-  } else {
451
-    if (1 != this.h) {
452
-      this.b = a;
453
-      S(this.c);
454
-      a = new I(this.a, a);
455
-      for (var c = a.a;c <= a.c;c++) {
456
-        for (var b = a.b;b <= a.f;b++) {
457
-          var e = new p(c, b), d = J(Q(this.c, e));
458
-          O(this.c, e, null == d ? "\u2009" : d);
459
-        }
460
-      }
461
-    }
462
-  }
463
-};
464
-function wa(a, c) {
465
-  a.g = c;
466
-  S(a.c);
467
-  var b = new Y(a.c);
468
-  b.start(a.a);
469
-  b.i(a.b);
470
-  b = u(a.g, a.f).add(ha(new I(a.a, a.b)));
471
-  xa(a, b);
472
-}
473
-function xa(a, c) {
474
-  for (var b = n(a.l), e = b.next();!e.done;e = b.next()) {
475
-    var e = e.value, d = e.value;
476
-    O(a.c, e.position.add(c), d);
477
-  }
478
-}
479
-g.m = function() {
480
-  this.f && (P(this.c), this.b = this.a = null);
481
-  this.g = this.f = null;
482
-  this.h = !0;
483
-};
484
-g.o = function(a) {
485
-  return this.a && this.b && (new I(this.a, this.b)).contains(a) ? "pointer" : "default";
486
-};
487
-g.j = function(a) {
488
-  if (this.a && this.b && ("<copy>" != a && "<cut>" != a || va(this), "<cut>" == a)) {
489
-    var c = new Y(this.c);
490
-    c.start(this.a);
491
-    c.i(this.b);
492
-    P(this.c);
493
-  }
494
-  "<paste>" == a && (xa(this, this.a), P(this.c));
495
-};
496
-function ya(a) {
497
-  this.b = a;
498
-  this.c = this.a = null;
499
-}
500
-g = ya.prototype;
501
-g.start = function(a) {
502
-  P(this.b);
503
-  $("#text-tool-input").val("");
504
-  this.a = a;
505
-  a = J(Q(this.b, this.a));
506
-  O(this.b, this.a, null == a ? "\u2009" : a);
507
-};
508
-g.i = function() {
509
-};
510
-g.m = function() {
511
-  null != this.a && (this.c = this.a, this.a = null, $("#text-tool-widget").hide(0, function() {
512
-    $("#text-tool-widget").show(0, function() {
513
-      $("#text-tool-input").focus();
514
-    });
515
-  }));
516
-};
517
-g.o = function() {
518
-  return "pointer";
519
-};
520
-g.j = function() {
521
-  var a = $("#text-tool-input").val();
522
-  S(this.b);
523
-  for (var c = this.b, b = this.c, e = 0, d = 0, a = n(a), f = a.next();!f.done;f = a.next()) {
524
-    f = f.value, "\n" == f ? (d++, e = 0) : (O(c, b.add(new p(e, d)), f), e++);
525
-  }
526
-};
527
-function za(a) {
528
-  this.a = a;
529
-  this.b = null;
530
-  this.c = [];
531
-}
532
-g = za.prototype;
533
-g.start = function(a) {
534
-  var c;
535
-  if (B) {
536
-    if (L(Q(this.a, a))) {
537
-      c = a;
538
-    } else {
539
-      var b = H.concat([C.add(F), C.add(G), E.add(F), E.add(G)]);
540
-      c = null;
541
-      for (var e = 0, b = n(b), d = b.next();!d.done;d = b.next()) {
542
-        var d = d.value, f = a.add(d), k = N(U(this.a, f));
543
-        L(Q(this.a, f)) && k > e && (c = d, e = k);
544
-      }
545
-      c = null == c ? a : a.add(c);
546
-    }
547
-  } else {
548
-    c = a;
549
-  }
550
-  this.b = c;
551
-  this.c = [];
552
-  if (L(Q(this.a, this.b))) {
553
-    U(this.a, this.b);
554
-    c = [];
555
-    e = n(H);
556
-    for (b = e.next();!b.done;b = e.next()) {
557
-      for (b = b.value, d = Aa(this, this.b, b), d = n(d), f = d.next();!f.done;f = d.next()) {
558
-        var f = f.value, k = 0 != b.x, l = -1 != A.indexOf(J(Q(this.a, a))), v = -1 != A.indexOf(J(Q(this.a, f)));
559
-        if (1 == N(U(this.a, f))) {
560
-          c.push({position:f, s:k, v:l, u:v});
561
-        } else {
562
-          for (var D = n(H), q = D.next();!q.done;q = D.next()) {
563
-            q = q.value, 0 != b.add(q).length() && 2 != b.add(q).length() && (q = Aa(this, f, q), q.length && (q = q[0], c.push({position:q, s:k, v:l, w:v, u:-1 != A.indexOf(J(Q(this.a, q)))})));
564
-          }
565
-        }
566
-      }
567
-    }
568
-    this.c = c;
569
-    this.i(this.b);
570
-  }
571
-};
572
-g.i = function(a) {
573
-  S(this.a);
574
-  for (var c = n(this.c), b = c.next();!b.done;b = c.next()) {
575
-    b = b.value, V(this.a, this.b, b.position, b.s, " ");
576
-  }
577
-  c = n(this.c);
578
-  for (b = c.next();!b.done;b = c.next()) {
579
-    b = b.value, V(this.a, a, b.position, b.s);
580
-  }
581
-  c = n(this.c);
582
-  for (b = c.next();!b.done;b = c.next()) {
583
-    b = b.value, b.v && O(this.a, a, "^"), b.u && O(this.a, b.position, "^"), b.w && O(this.a, new p(b.s ? b.position.x : a.x, b.s ? a.y : b.position.y), "^");
584
-  }
585
-};
586
-g.m = function() {
587
-  P(this.a);
588
-};
589
-function Aa(a, c, b) {
590
-  for (var e = c.clone(), d = [];;) {
591
-    var f = e.add(b);
592
-    if (!L(Q(a.a, f))) {
593
-      return t(c, e) || d.push(e), d;
594
-    }
595
-    e = f;
596
-    3 == N(U(a.a, e)) && d.push(e);
597
-  }
598
-}
599
-g.o = function(a) {
600
-  return L(Q(this.a, a)) ? "pointer" : "default";
601
-};
602
-g.j = function() {
603
-};
604
-function Ba(a, c) {
605
-  this.a = a;
606
-  this.value = c;
607
-  B && ($("#freeform-tool-input").val(""), $("#freeform-tool-input").hide(0, function() {
608
-    $("#freeform-tool-input").show(0, function() {
609
-      $("#freeform-tool-input").focus();
610
-    });
611
-  }));
612
-}
613
-g = Ba.prototype;
614
-g.start = function(a) {
615
-  O(this.a, a, this.value);
616
-};
617
-g.i = function(a) {
618
-  O(this.a, a, this.value);
619
-};
620
-g.m = function() {
621
-  P(this.a);
622
-};
623
-g.o = function() {
624
-  return "crosshair";
625
-};
626
-g.j = function(a) {
627
-  B && (this.value = $("#freeform-tool-input").val().substr(0, 1), $("#freeform-tool-input").blur(), $("#freeform-tool-input").hide(0));
628
-  1 == a.length && (this.value = a);
629
-};
630
-function Ca(a, c) {
631
-  var b = X(a.a, c);
632
-  a.f || (a.f = b);
633
-  t(b, a.f) || (a.a.b.style.cursor = a.c.o(b));
634
-  2 != a.mode || t(b, a.f) || a.c.i(b);
635
-  if (1 == a.mode) {
636
-    var e = a.a, d = a.h.add(u(a.g, c).scale(1 / a.a.c));
637
-    e.a = d;
638
-    e.f = !0;
639
-  }
640
-  a.f = b;
641
-}
642
-function Z(a) {
643
-  2 == a.mode && a.c.m();
644
-  a.mode = 0;
645
-  a.g = null;
646
-  a.h = null;
647
-  a.f = null;
648
-}
649
-function Da(a) {
650
-  $(window).resize(function() {
651
-    qa(a.a);
652
-  });
653
-  $("#draw-tools > button.tool").click(function(c) {
654
-    $("#text-tool-widget").hide(0);
655
-    c = c.target.id;
656
-    $("#draw-tools > button.tool").removeClass("active");
657
-    $("#" + c).toggleClass("active");
658
-    $(".dialog").removeClass("visible");
659
-    "box-button" == c && (a.c = new W(a.b));
660
-    "line-button" == c && (a.c = new ta(a.b, !1));
661
-    "arrow-button" == c && (a.c = new ta(a.b, !0));
662
-    "freeform-button" == c && (a.c = new Ba(a.b, "X"));
663
-    "erase-button" == c && (a.c = new Y(a.b));
664
-    "move-button" == c && (a.c = new za(a.b));
665
-    "text-button" == c && (a.c = new ya(a.b));
666
-    "select-button" == c && (a.c = new ua(a.b));
667
-    P(a.b);
668
-    a.a.b.focus();
669
-  });
670
-  $("#file-tools > button.tool").click(function(c) {
671
-    c = c.target.id;
672
-    $(".dialog").removeClass("visible");
673
-    $("#" + c + "-dialog").toggleClass("visible");
674
-    "import-button" == c && ($("#import-area").val(""), $("#import-area").focus());
675
-    "export-button" == c && ($("#export-area").val(pa(a.b)), $("#export-area").select());
676
-    "clear-button" == c && ma(a.b);
677
-    "undo-button" == c && na(a.b);
678
-    "redo-button" == c && oa(a.b);
679
-  });
680
-  $("button.close-dialog-button").click(function() {
681
-    $(".dialog").removeClass("visible");
682
-  });
683
-  $("#import-submit-button").click(function() {
684
-    ma(a.b);
685
-    for (var c = a.b, b = $("#import-area").val(), e = X(a.a, new p(a.a.b.width / 2, a.a.b.height / 2)), b = b.split("\n"), d = new p(0, Math.round(b.length / 2)), f = 0;f < b.length;f++) {
686
-      d.x = Math.max(d.x, Math.round(b[f].length / 2));
687
-    }
688
-    for (f = 0;f < b.length;f++) {
689
-      for (var k = b[f], l = 0;l < k.length;l++) {
690
-        var v = k.charAt(l);
691
-        z.includes(v) && (v = "+");
692
-        O(c, u((new p(l, f)).add(e), d), v);
693
-      }
694
-    }
695
-    P(a.b);
696
-    $("#import-area").val("");
697
-    $(".dialog").removeClass("visible");
698
-  });
699
-  $("#use-lines-button").click(function() {
700
-    $(".dialog").removeClass("visible");
701
-    var c = a.a;
702
-    c.h = !0;
703
-    c.f = !0;
704
-  });
705
-  $("#use-ascii-button").click(function() {
706
-    $(".dialog").removeClass("visible");
707
-    var c = a.a;
708
-    c.h = !1;
709
-    c.f = !0;
710
-  });
711
-  $(window).keypress(function(c) {
712
-    c.ctrlKey || c.metaKey || 13 == c.keyCode || a.c.j(String.fromCharCode(c.keyCode));
713
-  });
714
-  $(window).keydown(function(c) {
715
-    var b = null;
716
-    if (c.ctrlKey || c.metaKey) {
717
-      67 == c.keyCode && (b = "<copy>"), 86 == c.keyCode && (b = "<paste>"), 90 == c.keyCode && na(a.b), 89 == c.keyCode && oa(a.b), 88 == c.keyCode && (b = "<cut>");
718
-    }
719
-    8 == c.keyCode && (b = "<backspace>");
720
-    13 == c.keyCode && (b = "<enter>");
721
-    38 == c.keyCode && (b = "<up>");
722
-    40 == c.keyCode && (b = "<down>");
723
-    37 == c.keyCode && (b = "<left>");
724
-    39 == c.keyCode && (b = "<right>");
725
-    null != b && a.c.j(b);
726
-  });
727
-  $("#text-tool-input, #freeform-tool-input").keyup(function() {
728
-    a.c.j("");
729
-  });
730
-  $("#text-tool-input, #freeform-tool-input").change(function() {
731
-    a.c.j("");
732
-  });
733
-  $("#text-tool-close").click(function() {
734
-    $("#text-tool-widget").hide();
735
-    P(a.b);
736
-  });
737
-}
738
-;function Ea(a) {
739
-  var c = $(a.a.a.b);
740
-  c.on("mousewheel", function(b) {
741
-    b = a.a.a.c * (0 < b.originalEvent.wheelDelta ? 1.1 : .9);
742
-    b = Math.max(Math.min(b, 5), .2);
743
-    var c = a.a.a;
744
-    c.c = b;
745
-    c.f = !0;
746
-  });
747
-  c.mousedown(function(b) {
748
-    if (b.ctrlKey || b.metaKey) {
749
-      var c = a.a;
750
-      b = new p(b.clientX, b.clientY);
751
-      c.mode = 1;
752
-      c.g = b;
753
-      c.h = c.a.a;
754
-    } else {
755
-      c = a.a, b = new p(b.clientX, b.clientY), c.mode = 2, c.c.start(X(c.a, b));
756
-    }
757
-  });
758
-  c.mouseup(function() {
759
-    Z(a.a);
760
-  });
761
-  c.mouseleave(function() {
762
-    Z(a.a);
763
-  });
764
-  c.mousemove(function(b) {
765
-    Ca(a.a, new p(b.clientX, b.clientY));
766
-  });
767
-}
768
-function Fa(a, c) {
769
-  a.f = c;
770
-  a.h = $.now();
771
-  a.b = !1;
772
-  window.setTimeout(function() {
773
-    if (!a.b && !a.c && a.f) {
774
-      var b = a.a;
775
-      b.mode = 2;
776
-      b.c.start(X(b.a, c));
777
-    }
778
-  }, 150);
779
-}
780
-function Ga(a) {
781
-  var c = $(a.a.a.b);
782
-  c.on("touchstart", function(b) {
783
-    b.preventDefault();
784
-    if (1 == b.originalEvent.touches.length) {
785
-      Fa(a, r(b));
786
-    } else {
787
-      if (1 < b.originalEvent.touches.length) {
788
-        var c = r(b, 0);
789
-        b = r(b, 1);
790
-        Z(a.a);
791
-        a.c = !0;
792
-        a.b = !1;
793
-        a.l = u(c, b).length();
794
-        a.g = a.a.a.c;
795
-      }
796
-    }
797
-  });
798
-  c.on("touchmove", function(b) {
799
-    b.preventDefault();
800
-    if (1 == b.originalEvent.touches.length) {
801
-      b = r(b);
802
-      if (!a.b && 150 > $.now() - a.h && 6 < u(b, a.f).length()) {
803
-        a.b = !0;
804
-        var c = a.a;
805
-        c.mode = 1;
806
-        c.g = b;
807
-        c.h = c.a.a;
808
-      }
809
-      Ca(a.a, b);
810
-    } else {
811
-      1 < b.originalEvent.touches.length && a.c && (b = a.g * u(r(b, 0), r(b, 1)).length() / a.l, b = Math.max(Math.min(b, 5), .5), c = a.a.a, c.c = b, c.f = !0);
812
-    }
813
-  });
814
-  c.on("touchend", function(b) {
815
-    b.preventDefault();
816
-    a.b = !1;
817
-    a.c = !1;
818
-    a.f = null;
819
-    Z(a.a);
820
-  });
821
-}
822
-;var Ha = new function() {
823
-  this.a = Array(2E3);
824
-  this.b = [];
825
-  this.c = !0;
826
-  this.g = [];
827
-  this.f = [];
828
-  for (var a = 0;a < this.a.length;a++) {
829
-    this.a[a] = Array(600);
830
-    for (var c = 0;c < this.a[a].length;c++) {
831
-      this.a[a][c] = new ia;
832
-    }
833
-  }
834
-}, Ia = new function(a) {
835
-  this.g = a;
836
-  this.b = document.getElementById("ascii-canvas");
837
-  this.context = this.b.getContext("2d");
838
-  this.c = 1;
839
-  this.a = new p(9E3, 5100);
840
-  this.f = !0;
841
-  this.h = !1;
842
-  qa(this);
843
-}(Ha), Ja = new function(a, c) {
844
-  this.a = a;
845
-  this.b = c;
846
-  this.c = new W(c);
847
-  this.mode = 0;
848
-  this.f = null;
849
-  Da(this);
850
-}(Ia, Ha);
851
-new function(a) {
852
-  this.a = a;
853
-  this.c = this.b = !1;
854
-  Ga(this);
855
-}(Ja);
856
-new function(a) {
857
-  this.a = a;
858
-  Ea(this);
859
-}(Ja);
860
-ra(Ia);
861
-

Loading…
Cancel
Save