PageSourceSearch

https://alfredcurrier.com/wp-content/plugins/cm-alpha/ui-media-player/js/documents.js?ver=1790950511

js alfredcurrier.com collected 2026-10-02 14:17:18 UTC 2,540 bytes, 71 lines download raw bytes

1/**
2 * CM Media Player - Document Module
3 * 
4 * Handles document viewing in modals
5 */
6
7(function($) {
8    // Create the document viewer content for a modal
9    window.cmCreateDocumentContent = function(content, settings) {
10        // Document URL or content
11        const documentUrl = typeof content === 'string' ? content.trim() : '';
12        const fileExtension = documentUrl.split('.').pop().toLowerCase();
13        
14        let viewerContent = '';
15        
16        // Different handling based on document type
17        switch (fileExtension) {
18            case 'pdf':
19                viewerContent = `
20                    <div class="cm-document-viewer cm-pdf-viewer">
21                        <iframe 
22                            src="${documentUrl}" 
23                            width="100%" 
24                            height="100%" 
25                            style="border: none;">
26                        </iframe>
27                    </div>
28                `;
29                break;
30                
31            case 'doc':
32            case 'docx':
33            case 'xls':
34            case 'xlsx':
35            case 'ppt':
36            case 'pptx':
37                // For Microsoft Office documents, use Office Online viewer if available
38                viewerContent = `
39                    <div class="cm-document-viewer cm-office-viewer">
40                        <iframe 
41                            src="https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(documentUrl)}" 
42                            width="100%" 
43                            height="100%" 
44                            style="border: none;">
45                        </iframe>
46                    </div>
47                `;
48                break;
49                
50            default:
51                // For unsupported document types, provide a download link
52                viewerContent = `
53                    <div class="cm-document-viewer cm-unsupported-document">
54                        <p>This document type cannot be previewed directly.</p>
55                        <a href="${documentUrl}" target="_blank" class="cm-document-download">
56                            Download Document
57                        </a>
58                    </div>
59                `;
60                break;
61        }
62        
63        return {
64            success: true,
65            content: viewerContent,
66            containerClass: 'cm-modal-document',
67            contentType: 'document',
68            documentUrl: documentUrl
69        };
70    };
71})(jQuery); 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.