ソースを参照

Adds mousemove listeners to the etherpad iframes.

Adds css styles so the etherpad buttons beneath the header are accessible.
j8
fo 10年前
コミット
c5869b79b6
2個のファイルの変更42行の追加3行の削除
  1. 2
    1
      css/videolayout_default.css
  2. 40
    2
      etherpad.js

+ 2
- 1
css/videolayout_default.css ファイルの表示

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

+ 40
- 2
etherpad.js ファイルの表示

@@ -46,7 +46,6 @@ var Etherpad = (function (my) {
46 46
                     largeVideo.css({opacity: '0'});
47 47
                 } else {
48 48
                     VideoLayout.setLargeVideoVisible(false);
49
-                    ToolbarToggler.dockToolbar(true);
50 49
                 }
51 50
 
52 51
                 $('#etherpad>iframe').fadeIn(300, function () {
@@ -64,7 +63,6 @@ var Etherpad = (function (my) {
64 63
                 if (!isPresentation) {
65 64
                     $('#largeVideo').fadeIn(300, function () {
66 65
                         VideoLayout.setLargeVideoVisible(true);
67
-                        ToolbarToggler.dockToolbar(false);
68 66
                     });
69 67
                 }
70 68
             });
@@ -116,6 +114,46 @@ var Etherpad = (function (my) {
116 114
         etherpadIFrame.setAttribute('style', 'visibility: hidden;');
117 115
 
118 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
     /**

読み込み中…
キャンセル
保存