|
1370 | 1370 | "clipTimeVisible": hypervideos[thisHypervideoID].config.clipTimeVisible, |
1371 | 1371 | "hidden": hypervideos[thisHypervideoID].hidden, |
1372 | 1372 | "theme": hypervideos[thisHypervideoID].config.theme || "", |
1373 | | - "layoutArea": (FrameTrail.module('ViewLayout') && FrameTrail.module('ViewLayout').getLayoutAreaData) |
1374 | | - ? FrameTrail.module('ViewLayout').getLayoutAreaData() |
1375 | | - : hypervideos[thisHypervideoID].config.layoutArea |
| 1373 | + "layoutArea": (function () { |
| 1374 | + var layoutArea = (FrameTrail.module('ViewLayout') && FrameTrail.module('ViewLayout').getLayoutAreaData) |
| 1375 | + ? FrameTrail.module('ViewLayout').getLayoutAreaData() |
| 1376 | + : hypervideos[thisHypervideoID].config.layoutArea; |
| 1377 | + |
| 1378 | + // Convert Transcript contentViews to CustomHTML so exports are self-contained |
| 1379 | + var areas = ['areaTop', 'areaBottom', 'areaLeft', 'areaRight']; |
| 1380 | + for (var a = 0; a < areas.length; a++) { |
| 1381 | + var areaKey = areas[a]; |
| 1382 | + if (!layoutArea[areaKey]) continue; |
| 1383 | + for (var cv = 0; cv < layoutArea[areaKey].length; cv++) { |
| 1384 | + var cvData = layoutArea[areaKey][cv]; |
| 1385 | + if (cvData.type === 'Transcript' && cvData.transcriptSource) { |
| 1386 | + var subs = subtitles[cvData.transcriptSource]; |
| 1387 | + if (subs && subs.cues) { |
| 1388 | + var html = '<div class="transcriptContainer">'; |
| 1389 | + for (var c = 0; c < subs.cues.length; c++) { |
| 1390 | + var cue = subs.cues[c]; |
| 1391 | + html += '<span class="timebased" data-start="' + cue.startTime + '" data-end="' + cue.endTime + '">' |
| 1392 | + + cue.text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') |
| 1393 | + + ' </span>'; |
| 1394 | + } |
| 1395 | + html += '</div>'; |
| 1396 | + layoutArea[areaKey][cv] = { |
| 1397 | + type: 'CustomHTML', |
| 1398 | + name: cvData.name, |
| 1399 | + icon: cvData.icon, |
| 1400 | + cssClass: cvData.cssClass, |
| 1401 | + html: html, |
| 1402 | + collectionFilter: cvData.collectionFilter, |
| 1403 | + contentSize: cvData.contentSize, |
| 1404 | + onClickContentItem: cvData.onClickContentItem, |
| 1405 | + initClosed: cvData.initClosed, |
| 1406 | + filterAspect: cvData.filterAspect, |
| 1407 | + zoomControls: cvData.zoomControls |
| 1408 | + }; |
| 1409 | + } |
| 1410 | + } |
| 1411 | + } |
| 1412 | + } |
| 1413 | + |
| 1414 | + return layoutArea; |
| 1415 | + })() |
1376 | 1416 | }, |
1377 | 1417 | "clips": hypervideos[thisHypervideoID].clips, |
1378 | 1418 | "globalEvents": (codeSnippets.globalEvents) ? codeSnippets.globalEvents : {}, |
|
0 commit comments