initial commit
[CPE_learningsite] / CPE / CPE.App / CPE.App.Web / Views / rebroadcast / recording.cshtml
1 @model CPE.App.Web.Models.RecordingView
2 @{
3     Layout = null;
4 }
5
6 <!DOCTYPE html>
7
8 <html>
9     <head>
10         <meta http-equiv="X-UA-Compatible" content="IE=9" />
11         <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE" />
12         <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE" />
13         <title>@Model.Name</title>
14     <link rel="stylesheet" href="/static/css/index/recording.css"/>
15         <script type="text/javascript" src="/static/js/jquery-1.10.1.min.js"></script>
16         <script type="text/javascript" src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
17         <link rel="stylesheet" href="/static/css/redmond/jquery-ui-1.10.3.custom.min.css"/>
18         <style>
19             .ui-tooltip, .arrow:after {
20                 background: #004B73; 
21                 border: 1px solid #004B73;
22             }
23             .ui-tooltip {
24                 padding: 5px 10px;
25                 color: white;
26                 border-radius: 5px;
27             }
28         </style>
29         <script type="text/javascript" src="/static/js/detect-zoom.js"></script>
30         <script type="text/javascript">
31             var isXP = false;
32             var isChrome = false;
33             if (navigator.platform.toUpperCase().indexOf('WIN') !== -1 && navigator.userAgent.indexOf('NT 5.1') !== -1) {
34                 isXP = true;
35             }
36             if (window.chrome) {
37                 isChrome = true;
38             }
39             var isIE = false;
40             var isIE8orLower = false;
41         </script>
42         <!--[if IE]>
43             <style>
44                 body{ margin: 1px;}
45             </style>
46             <script type="text/javascript">
47                 isIE = true;
48             </script>
49         <![endif]-->
50         <!--[if lte IE 8]>
51             <script type="text/javascript">
52                 isIE8orLower = true;
53             </script>
54         <![endif]-->
55
56         <script type="text/javascript" src="/static/js/jquery-1.10.1.min.js"></script>
57         <script type="text/javascript" src="/static/js/jquery-ui.min.js"></script>
58         <script type="text/javascript">
59             var zoom = 1;
60             $('document').ready(function () {
61                 //trackEnter();
62
63                 if (!isIE) {
64                 
65                     var dialog = $('#question').dialog({
66                         autoOpen: false,
67                         bgiframe: true,
68                         title: "Submit a Question",
69                         width: 480,
70                         height: 768,
71                         zIndex: 9000,
72                         stack: false,
73                         open: function () {
74                             var winHeight = $(window).height();
75                             var dlgHeight = 768;
76
77                             if (winHeight < dlgHeight) {
78                                 dlgHeight = winHeight;
79                             }
80                             $("#question").dialog("option", "height", dlgHeight);
81                         
82                             $('#question').empty();
83                             $("#question").append('<iframe height="768" allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;border:none" src="@Model.QAlink"/>');
84                         }
85                     });
86
87                     function showSurvey() {
88                         //display wufoo
89                         var openWindow = isIE || (isXP && isChrome);
90                         if (!openWindow) {
91                             dialog.dialog('open');
92                         } else {
93                             openSurveyWindow();
94                         }
95                     }
96
97                     ;
98
99                     $('#btnQuestion').click(function () {
100                         showSurvey();
101                     });
102                     $('.hover-text').tooltip();
103
104                     if (isXP && isChrome) {
105                         setTimeout(function () {
106                             $('#btnQuestion').trigger('mouseover');
107                             $("#btnQuestion").trigger("hover");
108                             $(".hover-text").tooltip("destroy");
109                         }, 10000);
110                     }
111                 } else {
112                     $('div.control_layer').remove();
113                     $('#iframe-fix').remove();
114                     checkHeight();
115
116                     $(window).resize(function () {
117                         checkHeight();
118                     });
119
120                 }
121                 zoom = DetectZoom.zoom();
122                 setOverlayHeightFromZoom(zoom);
123
124                 $(window).resize(function () {
125                     checkZoom(true);
126                 });
127
128                 if (isIE8orLower) {
129                     setInterval(function () {
130                         checkZoom();
131                     }, 500);
132                 }
133             });
134             function openSurveyWindow() {
135                 var link = "@Model.QAlink";
136                 link = link.replace(/&amp;/gi, '&');
137                 window.open(link, "_blank", "height=768, width=480, toolbar=0, location=0, status=1, scrollbars=1, resizable=1");
138             };
139             var leaving = false;
140             window.onbeforeunload = function () {
141                 trackExit();
142
143                 if (!leaving) {
144                     leaving = true;
145                     setTimeout(function () {
146                         loadSurvey();
147                     }, 100);
148                     var browser = navigator.userAgent.toLowerCase();
149                     var response = "";
150                     if (browser.indexOf("firefox") > -1)
151                         response = "Please click \"Stay on Page\" at the next prompt to take a brief moment to complete our Survey.";
152                     else if (browser.indexOf("msie") > -1)
153                         response = "Please click \"Cancel\" to stay on the current page to take a brief moment to complete our Survey.";
154                     else if (browser.indexOf("webkit") > -1)
155                         response = "Please click \"Stay on this Page\" to take a brief moment to complete our Survey.";
156                     else if (browser.indexOf("opera") > -1)
157                         response = "Please click \"Cancel\" to stay on the current page to take a brief moment to complete our Survey.";
158                     else
159                         response = "Please click \"Cancel\" to stay on the current page to take a brief moment to complete our Survey.";
160                     if (/Firefox[\/\s](\d+)/.test(navigator.userAgent) && new Number(RegExp.$1) >= 4)
161                         alert(response);
162                     return response;
163                 }
164             };
165
166             function loadSurvey() {
167                 window.location = "/index/wufoo/@Model.PrincipalId";
168             }
169
170 //        function trackEnter() {
171 //            var principalId = $("#principal_id").val();
172 //            var meetingSessionKey = $("#meetingSessionKey").val();
173 //            var first = $("#firstname").val();
174 //            var last = $("#lastname").val();
175 //            var email = $("#email").val();
176
177 //            var url = "/static/services/engagement/service.asmx/TrackUser?meetingSessionKey=" + meetingSessionKey +
178 //                "&principal_id=" + principalId + "&firstname=" + encodeURIComponent(first) + "&lastname=" + encodeURIComponent(last) +
179 //                    "&email=" + encodeURIComponent(email) + "&type=0";
180 //            //alert(url);
181 //            //TrackUser(int meetingSessionKey, int principal_id, string firstname, string lastname, string email, byte type)
182 //            $.ajax({
183 //                url: url,
184 //                type: "GET",
185 //                cache: false
186 //            });
187 //        }
188         
189             function trackExit() {
190                 var principalId = $("#principal_id").val();
191                 var meetingSessionKey = $("#meetingSessionKey").val();
192                 var first = $("#firstname").val();
193                 var last = $("#lastname").val();
194                 var email = $("#email").val();
195
196                 //TrackUser(int meetingSessionKey, int principal_id, string firstname, string lastname, string email, byte type)
197                 var url = "/static/services/engagement/service.asmx/TrackUser?meetingSessionKey=" + meetingSessionKey +
198                     "&principal_id=" + principalId + "&firstname=" + encodeURIComponent(first) + "&lastname=" + encodeURIComponent(last) +
199                     "&email=" + encodeURIComponent(email) + "&type=1";
200                 //alert(url);
201                 $.ajax({
202                     url: url,
203                     type: "GET",
204                     cache: false
205                 });
206             }
207
208             function checkHeight() {
209                 var winHeight = $(window).height();
210
211                 if (winHeight <= 605) {
212                     $('div.ie_layer').css('height', '55px');
213                 }
214                 else {
215                     $('div.ie_layer').css('height', '45px');
216                 }
217             }
218             function checkZoom(isResize) {
219                 if(isResize === undefined || isResize === null) {
220                     isResize = false;
221                 }
222                 var zoomNew = DetectZoom.zoom();
223                 if (zoom != zoomNew) {
224                     // zoom has changed
225                     // adjust overlay height
226                     zoom = zoomNew;
227                     setOverlayHeightFromZoom(zoom);
228                 }
229                 else if(isResize) {
230                     setOverlayHeightFromZoom(zoom);
231                 }
232             }
233             function setOverlayHeightFromZoom(zoom) {
234                 var winHeight = $(window).height();
235
236                 if(zoom < 1) {
237                     winHeight = winHeight * zoom;
238                 }
239             
240                 var normalHeight = 45;
241                 if (winHeight <= 605 && zoom <= 1) {
242                     normalHeight = 55;
243                 }
244                 var normalWidth = 15;
245                 var newHeight;
246                 var newWidth;
247
248                 if (zoom < 1) {
249                     newHeight = normalHeight / zoom;
250                     newWidth = normalWidth / zoom;
251                 } else {
252                     newHeight = normalHeight;
253                     newWidth = normalWidth;
254                 }
255
256                 if ($('#control_layer').length > 0) {
257                     $('#control_layer').attr('style', 'z-index:8999;' + newHeight + 'px;');
258                     $('#control_layer').height(newHeight);
259                 }
260                 if ($('#ie_layer').length > 0) {
261                     $('#ie_layer').attr('style', 'z-index:8999;' + newHeight + 'px;');
262                     $('#ie_layer').height(newHeight);
263                 }
264
265                 if ($('#sidebar_layer').length > 0) {
266                     $('#sidebar_layer').attr('style', 'z-index:8999;' + newWidth + 'px;');
267                     $('#sidebar_layer').width(newWidth);
268                 }
269             }
270         </script>
271
272     </head>
273     <body>
274         <div id="question" class="hidden"></div>
275         <div id="container" style="height: 100%;width: 100%;">
276             <input id="meetingSessionKey" type="hidden" value="@Model.MeetingSessionKey"/>
277             <input id="principal_id" type="hidden" value="@Model.PrincipalId"/>
278             <input id="firstname" name="firstName" type="hidden" value="@Model.FirstName"/>
279             <input id="lastname" name="lastname" type="hidden" value="@Model.LastName"/>
280             <input id="email" name="email" type="hidden" value="@Model.Email"/>
281             <input id="certificate_id" type="hidden" value="@Model.CertificateId" />
282             <iframe id="iframe-sidebar-fix"style="position: absolute; left:0px; top:0px; width:15px; height:100%;z-index:8998; background: gray"></iframe>
283             <div id="sidebar_layer" class="sidebar_layer" style="z-index: 8999;">
284                 <!--[if IE]>
285                     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
286                             id="CpeLeftRecordingOverlay" width="100%" height="100%"
287                             codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
288                         <param name="movie" value="/static/swf/CpeLeftRecordingOverlay.swf" />
289                         <param name="quality" value="high" />
290                         <param name="bgcolor" value="gray" />
291                         <param name="allowScriptAccess" value="sameDomain" />
292                         <embed src="/static/swf/CpeLeftRecordingOverlay.swf" quality="high" bgcolor="gray"
293                                width="100%" height="100%" name="CpeLeftRecordingOverlay" align="middle"
294                                play="true"
295                                loop="false"
296                                quality="high"
297                                allowScriptAccess="sameDomain"
298                                type="application/x-shockwave-flash"
299                                pluginspage="http://www.adobe.com/go/getflashplayer">
300                         </embed>
301                     </object>
302                 <![endif]-->
303             </div>
304             <iframe id="iframe-fix"style="position: absolute; left:0px; bottom:0px; width:100%; height:50px; background:transparent"></iframe>
305             <div id="control_layer" class="control_layer" style="z-index: 8999;">
306                 <input type="button" class="hover-text" id="btnQuestion" title="Click Button to Send a Question" value="Submit a Question" style="z-index: 9000;"/>
307             </div>
308
309             <!--[if IE]>
310                 <div id="ie_layer" class="ie_layer" style="z-index: 8999;">
311                     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="display:block;"
312                             id="CpeRecordingOverlay" name="CpeRecordingOverlay" width="100%" height="100%"
313                             codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
314                         <param name="movie" value="/static/swf/CpeRecordingOverlay.swf" />
315                         <param name='flashVars' value='surveyUrl=@Url.Encode(@Model.QAlink)'/>
316                         <param name="quality" value="high" />
317                         <param name="bgcolor" value="gray" />
318                         <param name="allowScriptAccess" value="always" />
319                         <embed id="flashOverlay" src="/static/swf/CpeRecordingOverlay.swf" quality="high" bgcolor="gray"
320                                width="100%" height="100%" name="flashOverlay" align="middle"
321                                flashVars="surveyUrl=@Url.Encode(@Model.QAlink)"
322                                play="true"
323                                loop="false"
324                                quality="high"
325                                allowScriptAccess="always"
326                                type="application/x-shockwave-flash"
327                                pluginspage="http://www.adobe.com/go/getflashplayer">
328                         </embed>
329                     </object>
330                 </div>
331             <![endif]-->
332             <iframe id="connect-recording" src="@Model.Url" style="z-index: 0;" />@*/rebroadcast/RecordingProxy?recordingUrl=*@
333         </div>
334     </body>
335 </html>