@@ -25,14 +25,14 @@ window.Processing = require('./src/')(Browser);
25
25
},{"./src/":28}],2:[function(require,module,exports){
26
26
module.exports={
27
27
"name": "processing-js",
28
- "version": "1.4.12 ",
28
+ "version": "1.4.13 ",
29
29
"author": "Processing.js",
30
30
"repository": {
31
31
"type": "git",
32
32
"url": "git@github.com/processing-js/processing-js.git"
33
33
},
34
34
"main": "processing.min.js",
35
- "bugs": "https://github.com/processing-js/processing-js/issues",
35
+ "bugs": "https://github.com/processing-js/processing-js/issues",
36
36
"devDependencies": {
37
37
"argv": "~0.0.2",
38
38
"browserify": "~2.18.1",
@@ -47,7 +47,7 @@ module.exports={
47
47
"scripts": {
48
48
"test": "node test"
49
49
},
50
- "license": "MIT"
50
+ "license": "MIT"
51
51
}
52
52
53
53
},{}],3:[function(require,module,exports){
@@ -378,39 +378,90 @@ module.exports = {
378
378
},{}],5:[function(require,module,exports){
379
379
// the logger for println()
380
380
module.exports = function PjsConsole(document) {
381
- var e = {}, added = false;
382
- e.BufferMax = 200;
381
+ var e = { BufferMax: 200 },
382
+ style = document.createElement("style"),
383
+ added = false;
383
384
384
- e.wrapper = document.createElement("div");
385
+ style.textContent = [
386
+ ".pjsconsole.hidden {",
387
+ " display: none!important;",
388
+ "}"
389
+ ].join('\n');
385
390
386
- e.wrapper.setAttribute("style", "opacity:.75;display:block;position:fixed;bottom:0px;left:0px;right:0px;height:50px;background-color:#aaa");
391
+ e.wrapper = document.createElement("div");
392
+ style.textContent += [
393
+ "",
394
+ ".pjsconsole {",
395
+ " opacity: .75;",
396
+ " display: block;",
397
+ " position: fixed;",
398
+ " bottom: 0px;",
399
+ " left: 0px;",
400
+ " right: 0px;",
401
+ " height: 50px;",
402
+ " background-color: #aaa;",
403
+ "}"
404
+ ].join('\n');
405
+ e.wrapper.classList.add("pjsconsole");
387
406
388
407
e.dragger = document.createElement("div");
389
-
390
- e.dragger.setAttribute("style", "display:block;border:3px black raised;cursor:n-resize;position:absolute;top:0px;left:0px;right:0px;height:5px;background-color:#333");
408
+ style.textContent += [
409
+ "",
410
+ ".pjsconsole .dragger {",
411
+ " display: block;",
412
+ " border: 3px black raised;",
413
+ " cursor: n-resize;",
414
+ " position: absolute;",
415
+ " top: 0px;",
416
+ " left: 0px;",
417
+ " right: 0px;",
418
+ " height: 5px;",
419
+ " background-color: #333;",
420
+ "}"
421
+ ].join('\n');
422
+ e.dragger.classList.add("dragger");
391
423
392
424
e.closer = document.createElement("div");
393
-
394
- e.closer.onmouseover = function () {
395
- e.closer.style.setProperty("background-color", "#ccc");
396
- };
397
-
398
- e.closer.onmouseout = function () {
399
- e.closer.style.setProperty("background-color", "#ddd");
400
- };
401
-
425
+ style.textContent += [
426
+ "",
427
+ ".pjsconsole .closer {",
428
+ " opacity: .5;",
429
+ " display: block;",
430
+ " border: 3px black raised;",
431
+ " position: absolute;",
432
+ " top: 10px;",
433
+ " right: 30px;",
434
+ " height: 20px;",
435
+ " width: 20px;",
436
+ " background-color: #ddd;",
437
+ " color: #000;",
438
+ " line-height: 20px;",
439
+ " text-align: center;",
440
+ " cursor: pointer",
441
+ "}"
442
+ ].join('\n');
443
+ e.closer.classList.add("closer");
402
444
e.closer.innerHTML = "✖";
403
445
404
- e.closer.setAttribute("style", "opacity:.5;display:block;border:3px black raised;position:absolute;top:10px;right:30px;height:20px;width:20px;background-color:#ddd;color:#000;line-height:20px;text-align:center;cursor:pointer;");
405
-
406
446
e.javaconsole = document.createElement("div");
407
-
408
- e.javaconsole.setAttribute("style", "overflow-x: auto;display:block;position:absolute;left:10px;right:0px;bottom:5px;top:10px;overflow-y:scroll;height:40px;");
447
+ style.textContent += [
448
+ "",
449
+ ".pjsconsole .console {",
450
+ " overflow-x: auto;",
451
+ " display: block;",
452
+ " position: absolute;",
453
+ " left: 10px;",
454
+ " right: 0px;",
455
+ " bottom: 5px;",
456
+ " top: 10px;",
457
+ " overflow-y: scroll;",
458
+ " height: 40px;",
459
+ "}"
460
+ ].join('\n');
461
+ e.javaconsole.setAttribute("class", "console");
409
462
410
463
e.wrapper.appendChild(e.dragger);
411
-
412
464
e.wrapper.appendChild(e.javaconsole);
413
-
414
465
e.wrapper.appendChild(e.closer);
415
466
416
467
e.dragger.onmousedown = function (t) {
@@ -440,33 +491,29 @@ module.exports = function PjsConsole(document) {
440
491
if (e.BufferArray[e.BufferArray.length - 1]) e.BufferArray[e.BufferArray.length - 1] += (t) + "";
441
492
else e.BufferArray.push(t);
442
493
e.javaconsole.innerHTML = e.BufferArray.join('');
443
- if (e.wrapper.style.visibility === "hidden") {
444
- e.wrapper.style.visibility = "visible";
445
- }
446
- if (e.wrapper.style.visibility === "hidden") {
447
- e.wrapper.style.visibility = "visible";
448
- }
494
+ e.showconsole();
449
495
};
450
496
451
497
e.println = function () {
452
- if(!added) { document.body.appendChild(e.wrapper); }
498
+ if(!added) {
499
+ document.body.appendChild(style);
500
+ document.body.appendChild(e.wrapper);
501
+ added = true;
502
+ }
453
503
var args = Array.prototype.slice.call(arguments);
454
504
args.push('<br>');
455
505
e.print.apply(e, args);
456
- if (e.BufferArray.length > e.BufferMax) e.BufferArray.splice(0, 1);
457
- else e.javaconsole.scrollTop = e.javaconsole.scrollHeight ;
458
- };
459
- e.showconsole = function () {
460
- e.wrapper.style.visibility = "visible";
506
+ if (e.BufferArray.length > e.BufferMax) {
507
+ e.BufferArray.splice(0, 1) ;
508
+ } else {
509
+ e.javaconsole.scrollTop = e.javaconsole.scrollHeight;
510
+ }
461
511
};
462
512
463
- e.hideconsole = function () {
464
- e.wrapper.style.visibility = "hidden";
465
- };
513
+ e.showconsole = function () { e.wrapper.classList.remove("hidden"); };
514
+ e.hideconsole = function () { e.wrapper.classList.add("hidden"); };
466
515
467
- e.closer.onclick = function () {
468
- e.hideconsole();
469
- };
516
+ e.closer.onclick = function () { e.hideconsole(); };
470
517
471
518
e.hideconsole();
472
519
@@ -2107,7 +2154,7 @@ module.exports = function(options,undef) {
2107
2154
2108
2155
// set up the template element
2109
2156
var element = document.createElement("span");
2110
- element.style.cssText = 'position: absolute; top: 0 ; left: 0; opacity: 0; font-family: "PjsEmptyFont", fantasy;';
2157
+ element.style.cssText = 'position: absolute; top: -1000 ; left: 0; opacity: 0; font-family: "PjsEmptyFont", fantasy;';
2111
2158
element.innerHTML = "AAAAAAAA";
2112
2159
document.body.appendChild(element);
2113
2160
this.template = element;
0 commit comments