Browse Source

Adds mousemove listeners to the etherpad iframes.

Adds css styles so the etherpad buttons beneath the header are accessible.
j8
fo 10 years ago
parent
commit
c5869b79b6
2 changed files with 42 additions and 3 deletions
  1. 2
    1
      css/videolayout_default.css
  2. 40
    2
      etherpad.js

+ 2
- 1
css/videolayout_default.css View File

280
     left:0;
280
     left:0;
281
     right:0;
281
     right:0;
282
     z-index:10;
282
     z-index:10;
283
+    pointer-events: none;
283
 }
284
 }
284
 
285
 
285
 #toolbar {
286
 #toolbar {
295
     background-color: rgba(0,0,0,0.8); 
296
     background-color: rgba(0,0,0,0.8); 
296
     border: 1px solid rgba(256, 256, 256, 0.2);
297
     border: 1px solid rgba(256, 256, 256, 0.2);
297
     border-radius: 6px;
298
     border-radius: 6px;
298
-    
299
+    pointer-events: auto;
299
 }
300
 }
300
 
301
 
301
 #subject {
302
 #subject {

+ 40
- 2
etherpad.js View File

46
                     largeVideo.css({opacity: '0'});
46
                     largeVideo.css({opacity: '0'});
47
                 } else {
47
                 } else {
48
                     VideoLayout.setLargeVideoVisible(false);
48
                     VideoLayout.setLargeVideoVisible(false);
49
-                    ToolbarToggler.dockToolbar(true);
50
                 }
49
                 }
51
 
50
 
52
                 $('#etherpad>iframe').fadeIn(300, function () {
51
                 $('#etherpad>iframe').fadeIn(300, function () {
64
                 if (!isPresentation) {
63
                 if (!isPresentation) {
65
                     $('#largeVideo').fadeIn(300, function () {
64
                     $('#largeVideo').fadeIn(300, function () {
66
                         VideoLayout.setLargeVideoVisible(true);
65
                         VideoLayout.setLargeVideoVisible(true);
67
-                        ToolbarToggler.dockToolbar(false);
68
                     });
66
                     });
69
                 }
67
                 }
70
             });
68
             });
116
         etherpadIFrame.setAttribute('style', 'visibility: hidden;');
114
         etherpadIFrame.setAttribute('style', 'visibility: hidden;');
117
 
115
 
118
         document.getElementById('etherpad').appendChild(etherpadIFrame);
116
         document.getElementById('etherpad').appendChild(etherpadIFrame);
117
+
118
+        etherpadIFrame.onload = function() {
119
+
120
+            document.domain = document.domain;
121
+            bubbleIframeMouseMove(etherpadIFrame);
122
+            setTimeout(function() {
123
+            //the iframes inside of the etherpad are not yet loaded when the etherpad iframe is loaded
124
+                var outer = etherpadIFrame.contentDocument.getElementsByName("ace_outer")[0];
125
+                bubbleIframeMouseMove(outer);
126
+                var inner = outer.contentDocument.getElementsByName("ace_inner")[0];
127
+                bubbleIframeMouseMove(inner);
128
+            }, 2000);
129
+        };
130
+    }
131
+
132
+    function bubbleIframeMouseMove(iframe){
133
+        var existingOnMouseMove = iframe.contentWindow.onmousemove;
134
+        iframe.contentWindow.onmousemove = function(e){
135
+            if(existingOnMouseMove) existingOnMouseMove(e);
136
+            var evt = document.createEvent("MouseEvents");
137
+            var boundingClientRect = iframe.getBoundingClientRect();
138
+            evt.initMouseEvent(
139
+                "mousemove",
140
+                true, // bubbles
141
+                false, // not cancelable
142
+                window,
143
+                e.detail,
144
+                e.screenX,
145
+                e.screenY,
146
+                    e.clientX + boundingClientRect.left,
147
+                    e.clientY + boundingClientRect.top,
148
+                e.ctrlKey,
149
+                e.altKey,
150
+                e.shiftKey,
151
+                e.metaKey,
152
+                e.button,
153
+                null // no related element
154
+            );
155
+            iframe.dispatchEvent(evt);
156
+        };
119
     }
157
     }
120
 
158
 
121
     /**
159
     /**

Loading…
Cancel
Save