-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
53 lines (47 loc) · 2.24 KB
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// DOM Elements
const elements = {
// Status messages
loading: document.getElementById('loading'),
noVideo: document.getElementById('no-video'),
extensionError: document.getElementById('extension-error'),
errorMessage: document.getElementById('error-message-text'),
videoDetected: document.getElementById('video-detected'),
// Video info
videoInfo: document.getElementById('video-info'),
videoTitle: document.getElementById('video-title'),
videoDuration: document.getElementById('video-duration'),
videoWarning: document.getElementById('video-warning'),
// Playback controls
playbackControls: document.getElementById('playback-controls'),
basicControls: document.querySelector('.basic-controls'),
advancedControls: document.querySelector('.advanced-controls'),
playBtn: document.getElementById('play-btn'),
pauseBtn: document.getElementById('pause-btn'),
seekBackBtn: document.getElementById('seek-back-btn'),
seekForwardBtn: document.getElementById('seek-forward-btn'),
decreaseRateBtn: document.getElementById('decrease-rate-btn'),
increaseRateBtn: document.getElementById('increase-rate-btn'),
playbackRateElem: document.getElementById('playback-rate'),
// Options
lengthSelect: document.getElementById('summary-length'),
formatSelect: document.getElementById('format'),
focusKeyPoints: document.getElementById('focus-key-points'),
focusDetails: document.getElementById('focus-details'),
// Action buttons
summarizeBtn: document.getElementById('summarize-btn'),
openAppBtn: document.getElementById('open-app-btn'),
retryConnectionBtn: document.getElementById('retry-connection'),
// Summary display
summaryResult: document.getElementById('summary-result'),
summaryContent: document.getElementById('summary-content'),
copySummaryBtn: document.getElementById('copy-summary'),
saveSummaryBtn: document.getElementById('save-summary'),
closeSummaryBtn: document.getElementById('close-summary'),
summaryLength: document.getElementById('summary-length'),
};
// Add event listeners for platform-specific buttons
document.getElementById('youtube-summarize-btn').addEventListener('click', function() {
// Handle YouTube summarization
console.log('YouTube summarize button clicked');
startSummarizing();
});