1 2var AboutScreen = function(node) { 3 var 4 container = $('.windows-container'), 5 body = $(document.body), 6 win = $(window), 7 8 aboutButton = $('<div class="main-menu-item about-logo i18n" data-i18n="[html]menu.labels.about">About</div>') 9 .appendTo( $('#main-menu-features') ) 10 .on('click', aboutClick), 11 12 modalOverlay = $('<div class="modal-overlay"></div>') 13 .appendTo( body ) 14 .hide(), 15 isAboutLoaded = false, 16 aboutWindow = new MovableWindow(500, 250, i18n.t('menu.labels.about')); 17 18 aboutWindow.body 19 .css({padding: '20px'}); 20 21 aboutWindow.title.addClass('i18n').attr('data-i18n','[html]menu.labels.about'); 22 23 24 function hideAbout() { 25 aboutWindow.hide(); 26 modalOverlay.hide(); 27 container.removeClass('blur'); 28 } 29 30 modalOverlay.on('click', function() { 31 hideAbout(); 32 }); 33 34 aboutWindow.closeButton.on('click', function() { 35 hideAbout(); 36 }); 37 38 function aboutClick() { 39 if (aboutWindow.container.is(':visible')) { 40 hideAbout(); 41 } else { 42 43 $('#main-menu-dropdown').hide(); 44 45 var winWidth = win.width(), 46 winHeight = win.height(); 47 48 49 container.addClass('blur'); 50 51 aboutWindow 52 .size(.8*winWidth, 0.7*winHeight) 53 .show() 54 .center(); 55 56 modalOverlay 57 .width( winWidth ) 58 .height( winHeight ) 59 .show(); 60 61 62 if (!isAboutLoaded) { 63 64 aboutWindow.body.addClass('loading-indicator'); 65 66 // assume a local file first 67 $.ajax({ 68 url: sofia.config.aboutPagePath, 69 dataType: 'html', 70 success: function(data) { 71 aboutWindow.body.removeClass('loading-indicator'); 72 73 isAboutLoaded = true; 74 75 showAbout(data, sofia.config.aboutPagePath); 76 }, 77 error: function() { 78 79 if (sofia.config.baseContentUrl != '') { 80 81 console.log("No local about.html"); 82 83 // this one will go through the CDN 84 sofia.ajax({ 85 url: sofia.config.aboutPagePath, 86 dataType: 'text', 87 success: function(data) { 88 89 console.log('Success: CDN about.html', data.indexOf('<html')); 90 91 aboutWindow.body.removeClass('loading-indicator'); 92 93 isAboutLoaded = true; 94 95 showAbout(data, sofia.config.baseContentUrl + sofia.config.aboutPagePath); 96 }, 97 error: function() { 98 99 // error 100 console.log("Can't find a about.html"); 101 102 } 103 }); 104 } else { 105 106 console.log("No local about.html, no CDN to check"); 107 108 } 109 } 110 }); 111 } 112 } 113 } 114 115 function showAbout(data, url) { 116 117 if (data.indexOf('<html') > -1) { 118 119 aboutWindow.body.html('<iframe style="border: 0;" src="' + url + '"></iframe>'); 120 aboutWindow.body.css({padding: 2}); 121 122 var iframe = aboutWindow.body.find('iframe'); 123 124 iframe.css({ 125 width: aboutWindow.body.width(), 126 height: aboutWindow.body.height() - 5 127 }); 128 129 } else { 130 131 aboutWindow.body.html(data); 132 } 133 } 134 135 return aboutButton; 136}; 137sofia.menuComponents.push('AboutScreen');
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.