|
1098 | 1098 | + '<label><input type="radio" name="downloadFormat" value="html" checked> HTML</label>' |
1099 | 1099 | + '<label><input type="radio" name="downloadFormat" value="json"> JSON</label>' |
1100 | 1100 | + '</div>' |
1101 | | - + '<div style="margin-top: 6px;">' |
1102 | | - + '<small>' + labels['DownloadResourceBaseUrl'] + '</small>' |
1103 | | - + '<input type="text" name="htmlDataPath" placeholder="https://example.com/_data/" style="margin-top: 2px;">' |
1104 | | - + '</div>' |
| 1101 | + + (videoType === 'youtube' ? '<div class="message warning active youtubeExportWarning" style="margin-top: 8px;">' + labels['WarningYouTubeExport'] + '</div>' : '') |
1105 | 1102 | + '</div>' |
1106 | 1103 | + '<div class="downloadOptionsSection" style="display: none;">' |
1107 | 1104 | + '<div class="checkboxRow">' |
|
1117 | 1114 |
|
1118 | 1115 | var formatSection = saveAsDialog.querySelector('.downloadFormatSection'); |
1119 | 1116 | var optionsSection = saveAsDialog.querySelector('.downloadOptionsSection'); |
| 1117 | + var ytWarning = saveAsDialog.querySelector('.youtubeExportWarning'); |
1120 | 1118 |
|
1121 | | - // Default htmlDataPath to the absolute URL of the current _data/ directory |
1122 | | - var _dataPathInput = saveAsDialog.querySelector('[name="htmlDataPath"]'); |
1123 | | - var _resolvedDataURL = FrameTrail.module('RouteNavigation').resolveDataURL(''); |
1124 | | - _dataPathInput.value = new URL(_resolvedDataURL, window.location.href).href; |
| 1119 | + saveAsDialog.querySelectorAll('[name="downloadFormat"]').forEach(function(radio) { |
| 1120 | + radio.addEventListener('change', function() { |
| 1121 | + if (ytWarning) { |
| 1122 | + ytWarning.style.display = radio.value === 'html' && radio.checked ? '' : 'none'; |
| 1123 | + } |
| 1124 | + }); |
| 1125 | + }); |
1125 | 1126 |
|
1126 | 1127 | saveAsDialog.querySelectorAll('[name="downloadScope"]').forEach(function(radio) { |
1127 | 1128 | radio.addEventListener('change', function() { |
|
1171 | 1172 | } |
1172 | 1173 | } else { |
1173 | 1174 | var format = saveAsDialog.querySelector('[name="downloadFormat"]:checked').value; |
1174 | | - var dataPath = saveAsDialog.querySelector('[name="htmlDataPath"]').value.trim(); |
1175 | 1175 | if (format === 'html') { |
| 1176 | + var _resolvedDataURL = FrameTrail.module('RouteNavigation').resolveDataURL(''); |
| 1177 | + var dataPath = new URL(_resolvedDataURL, window.location.href).href; |
1176 | 1178 | downloadAdapter._generateStandaloneHTML(hvID, dataPath); |
1177 | 1179 | } else { |
1178 | | - downloadAdapter._performDownload(hvID, dataPath); |
| 1180 | + downloadAdapter._performDownload(hvID); |
1179 | 1181 | } |
1180 | 1182 | } |
1181 | 1183 |
|
|
0 commit comments