Index: trunk/extensions/VisualEditor/playground/playground.js |
— | — | @@ -25,6 +25,8 @@ |
26 | 26 | // Set initial content for the "editor"
|
27 | 27 | this.$editor.html("<b>Lorem Ipsum is simply dummy text</b> of the printing and typesetting industry. <b>Lorem Ipsum has been the <i>industry's</i> standard</b> dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it <u>to <b>make <i>a type</i> specimen</b> book.</u>");
|
28 | 28 |
|
| 29 | + this.keydown = false;
|
| 30 | + this.mousedown = false;
|
29 | 31 | this.prevText = app.getDOMText(this.$editor[0]);
|
30 | 32 |
|
31 | 33 | setInterval(function() {
|
— | — | @@ -33,21 +35,32 @@ |
34 | 36 | };
|
35 | 37 |
|
36 | 38 | app.prototype.onKeyDown = function() {
|
37 | | - console.log("onKeyDown");
|
| 39 | + this.keydown = true;
|
| 40 | + //console.log("onKeyDown");
|
38 | 41 | };
|
39 | 42 |
|
40 | 43 | app.prototype.onMouseDown = function() {
|
41 | | - console.log("onMouseDown");
|
| 44 | + this.mousedown = true;
|
| 45 | + //console.log("onMouseDown");
|
42 | 46 | };
|
43 | 47 |
|
44 | 48 | app.prototype.loopFunc = function() {
|
45 | 49 | var text = app.getDOMText(this.$editor[0]);
|
46 | 50 |
|
47 | 51 | if(text != this.prevText) {
|
48 | | - console.log(text);
|
| 52 | + //console.log(text);
|
49 | 53 |
|
| 54 | + if(this.keydown) {
|
| 55 | + console.log("change from keyboard");
|
| 56 | + } else {
|
| 57 | + console.log("change not from keyboard");
|
| 58 | + }
|
| 59 | +
|
50 | 60 | this.prevText = text;
|
51 | 61 | }
|
| 62 | +
|
| 63 | + this.keydown = false;
|
| 64 | + this.mousedown = false;
|
52 | 65 | };
|
53 | 66 |
|
54 | 67 | app.getDOMText = function( elem ) {
|