OLD | NEW |
1 <script type="text/javascript"> | 1 <script type="text/javascript"> |
2 function loadAbort(evt) { | 2 function loadAbort(evt) { |
3 document.title = evt.detail.reason; | 3 document.title = JSON.parse(evt.detail).reason; |
4 } | 4 } |
5 function loadStart(evt) { | 5 function loadStart(evt) { |
6 document.title = evt.detail.url; | 6 document.title = JSON.parse(evt.detail).url; |
7 } | 7 } |
8 function loadStop(evt) { | 8 function loadStop(evt) { |
9 document.title = "loadStop"; | 9 document.title = "loadStop"; |
10 } | 10 } |
11 | 11 |
12 var commitIsTopLevel; | 12 var commitIsTopLevel; |
13 function loadCommit(evt) { | 13 function loadCommit(evt) { |
14 document.title = "loadCommit:" + evt.detail.url; | 14 var detail = JSON.parse(evt.detail); |
15 commitIsTopLevel = evt.detail.isTopLevel; | 15 document.title = "loadCommit:" + detail.url; |
| 16 commitIsTopLevel = detail.isTopLevel; |
16 } | 17 } |
17 | 18 |
18 var redirectOldUrl; | 19 var redirectOldUrl; |
19 var redirectNewUrl; | 20 var redirectNewUrl; |
20 function loadRedirect(event) { | 21 function loadRedirect(event) { |
21 document.title = "redirected"; | 22 document.title = "redirected"; |
22 if (event.detail.isTopLevel) { | 23 var detail = JSON.parse(event.detail); |
23 redirectOldUrl = event.detail.oldUrl; | 24 if (detail.isTopLevel) { |
24 redirectNewUrl = event.detail.newUrl; | 25 redirectOldUrl = detail.oldUrl; |
| 26 redirectNewUrl = detail.newUrl; |
25 } | 27 } |
26 } | 28 } |
27 function SetSrc(src) { | 29 function SetSrc(src) { |
28 var plugin = document.getElementById('plugin'); | 30 var plugin = document.getElementById('plugin'); |
29 plugin.src = src; | 31 plugin.src = src; |
30 } | 32 } |
31 function SetSize(w, h) { | 33 function SetSize(w, h) { |
32 var plugin = document.getElementById('plugin'); | 34 var plugin = document.getElementById('plugin'); |
33 plugin.width = w; | 35 plugin.width = w; |
34 plugin.height = h; | 36 plugin.height = h; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 97 } |
96 } | 98 } |
97 var plugin = document.getElementById('plugin'); | 99 var plugin = document.getElementById('plugin'); |
98 plugin.addEventListener('-internal-loadstart', loadStart); | 100 plugin.addEventListener('-internal-loadstart', loadStart); |
99 plugin.addEventListener('-internal-loadabort', loadAbort); | 101 plugin.addEventListener('-internal-loadabort', loadAbort); |
100 plugin.addEventListener('-internal-loadredirect', loadRedirect); | 102 plugin.addEventListener('-internal-loadredirect', loadRedirect); |
101 window.addEventListener('message', receiveMessage, false); | 103 window.addEventListener('message', receiveMessage, false); |
102 plugin.addEventListener('-internal-loadstop', loadStop); | 104 plugin.addEventListener('-internal-loadstop', loadStop); |
103 plugin.addEventListener('-internal-loadcommit', loadCommit); | 105 plugin.addEventListener('-internal-loadcommit', loadCommit); |
104 </script> | 106 </script> |
OLD | NEW |